Skip to content

Conversation

fujitatomoya
Copy link
Contributor

closes #33

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
Comment on lines +58 to +59
# Create a deep copy of the input dictionary to avoid modifying it for safety
values = copy.deepcopy(values)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this function handles the nested structure internally, i would use deepcopy for the safety.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this have any sort of performance impact?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

of course it does. but i think this is not performance sensitive API. (besides python...)

assert arrays_msg.basic_types_values[2].uint8_value == 0


def test_set_nested_namespaced_fields_with_same_values():
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test fails with out this PR.

@fujitatomoya fujitatomoya requested a review from esteve April 11, 2025 19:15
@fujitatomoya
Copy link
Contributor Author

@esteve been a while, can you take a look at this minor fix when you have time? thanks in advance.

@fujitatomoya
Copy link
Contributor Author

Pulls: #34
Gist: https://gist.githubusercontent.com/fujitatomoya/50368e9c526c2ce0ac4370ce5a84fde7/raw/61f30a3e1bff2875976edf243ceac07947374832/ros2.repos
BUILD args: --packages-above-and-dependencies rosidl_runtime_py
TEST args: --packages-above rosidl_runtime_py
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/15671

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@mjcarroll
Copy link
Member

RHEL test failure is a known flake. LGTM.

@fujitatomoya fujitatomoya merged commit 4e7963d into rolling Apr 14, 2025
3 checks passed
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.

Don't overwrite the user-provided dict when converting to a message
2 participants