Treat bare YAML nan and inf as strings - #1323
Conversation
|
Tick the box to add this pull request to the merge queue (same as
|
Limit implicit non-finite float parsing to the YAML dot-prefixed forms so standalone parameter loading matches the composable-node path. Preserve generic non-finite forms when an explicit !!float tag requests them. Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
d968fb5 to
0bcf6ec
Compare
fujitatomoya
left a comment
There was a problem hiding this comment.
@Old-Ding the fix itself looks good to me.
seems like you are creating bunch of PRs in a few days.
please have a close look at https://discourse.openrobotics.org/t/guidelines-for-ai-assisted-contributions-in-the-ros-project/55903.
and can you provide the test result for this? either log or screen capture?
@Old-Ding friendly ping. |
|
Verification result for the current head: https://github.com/Old-Ding/rcl/actions/runs/29411533231 I ran the target package in an Ubuntu ROS Rolling container:
The full build and test log is linked above. |
|
@fujitatomoya Thank you for the reminder. I have read the AI-assisted contribution guidelines. This PR description discloses the use of Codex, and I reviewed the parser paths and the regression coverage before submitting it. Verification for the current PR source is here: https://github.com/Old-Ding/rcl/actions/runs/29411533231
The workflow branch contains only its verification workflow in addition to PR head |
Description
rcl_yaml_param_parserexplicitly handles the YAML 1.1 dot-prefixed non-finite forms such as.nanand.inf. Its genericstrtod()fallback also accepted untagged barenan,inf,+inf, and-inf, even though YAML treats those forms as strings.Reject non-finite results only during implicit type inference, leaving both the existing dot-prefixed forms and explicitly tagged values such as
!!float nanunchanged. Extend the special-float integration fixture to verify the four implicit bare forms remain strings and the four explicitly tagged forms remain doubles.Fixes #1320.
Is this user-facing behavior change?
Yes. Untagged bare
nanandinfparameter values are now strings, matching YAML and the composable-node parameter loading path. Valid dot-prefixed and explicit!!floatnon-finite values continue to be parsed as doubles.Did you use Generative AI?
Yes. OpenAI Codex assisted with root-cause analysis and preparing the focused code and regression test. I reviewed the diff and verification results.
Additional Information
Local verification:
YAML_FLOAT_TAGpath enables generic non-finite parsinggit diff --checkThe full
rcl_yaml_param_parsergtest requires ROS 2 build dependencies that are unavailable on this Windows host; repository CI covers the integration test.