Skip to content

Allow empty YAML entity lists#992

Open
Old-Ding wants to merge 1 commit into
ros2:rollingfrom
Old-Ding:codex/yaml-empty-entity-lists
Open

Allow empty YAML entity lists#992
Old-Ding wants to merge 1 commit into
ros2:rollingfrom
Old-Ding:codex/yaml-empty-entity-lists

Conversation

@Old-Ding

Copy link
Copy Markdown

Description

launch_yaml.Entity.get_attr() indexed the first item of every nested entity list while validating its shape. Explicitly empty lists such as arg: [] or let: [] therefore raised IndexError instead of being parsed as empty child collections.

Accept empty nested entity lists at the YAML adapter boundary and retain the existing dictionary check for non-empty lists. Add an include-action regression covering both empty argument forms.

Is this user-facing behavior change?

Yes. YAML launch files can now contain explicitly empty nested entity lists without failing during parsing.

Did you use Generative AI?

Yes. OpenAI Codex assisted with tracing the YAML parser data flow, preparing the focused fix and regression test, and reviewing the result. I reviewed the diff and verification output.

Additional Information

Local verification:

  • reproduced the Rolling IndexError with an empty List[Entity] attribute
  • all 17 launch_yaml functional tests passed
  • ament_flake8, ament_pep257, and ament_copyright passed for both changed files
  • Python bytecode compilation and git diff --check passed

Treat explicitly empty nested entity lists as valid input instead of indexing the missing first element. This lets generated YAML retain empty include argument lists without raising IndexError.

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

mergify Bot commented Jul 13, 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