Skip to content

Fix string representations for untyped parameters - #558

Open
Old-Ding wants to merge 1 commit into
ros2:rollingfrom
Old-Ding:codex/fix-parameter-default-string-repr
Open

Fix string representations for untyped parameters#558
Old-Ding wants to merge 1 commit into
ros2:rollingfrom
Old-Ding:codex/fix-parameter-default-string-repr

Conversation

@Old-Ding

@Old-Ding Old-Ding commented Jul 11, 2026

Copy link
Copy Markdown

Summary

  • handle the default value_type=None in parameter description string representations
  • preserve existing type names when an explicit type is configured
  • cover both ParameterValue and Parameter

Testing

  • focused source behavior probe: both baseline classes raise AttributeError, while the fixed classes render the default type as None
  • isolated class-level probes cover None, scalar int / str, and all four supported typing.List[...] value types
  • ament_flake8, ament_pep257, and ament_copyright on both modified files
  • python -m py_compile on both modified files
  • git diff --check
  • repository-native pytest is unavailable on this host because the compiled lifecycle_msgs package is not installed

ParameterValue and Parameter default value_type to None, but their string representations unconditionally accessed __name__. Render the default type as None and cover both public description classes.

Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
@mergify

mergify Bot commented Jul 11, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant