Parse YAML respawn delay strings#990
Open
Old-Ding wants to merge 1 commit into
Open
Conversation
Convert string-valued YAML respawn delays at the frontend boundary so valid floats reach ExecuteLocal and invalid values fail during parsing instead of raising a comparison TypeError. Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
|
Tick the box to add this pull request to the merge queue (same as
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The YAML frontend accepts strings for attributes declared as
float, butExecuteProcess.parse()compared a string-valuedrespawn_delaywith0.0before converting it. A launch file usingrespawn_delay: '2.0'therefore failed during parsing withTypeError: '<' not supported between instances of 'str' and 'float'.Convert string-valued respawn delays at the existing frontend parsing boundary. Valid values reach
ExecuteLocalas floats, while invalid strings fail immediately with a descriptiveValueError. Native float behavior and the runtime respawn state machine are unchanged.Is this user-facing behavior change?
Yes. Quoted numeric
respawn_delayvalues in YAML launch files now work consistently instead of failing with a comparisonTypeError. Invalid strings produce a parse-time error.Did you use Generative AI?
Yes. OpenAI Codex assisted with tracing the frontend data flow, preparing the focused fix and tests, and reviewing the result. I reviewed the diff and verification output.
Additional Information
Local verification:
respawn_delay: '2.0'launchfunctional tests passedlaunch_yamlfunctional tests passedament_mypypassed with zero errorsament_flake8,ament_pep257, andament_copyrightpassed for both changed filescompileallandgit diff --checkpassed