Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(packets): correct dict iteration syntax in Telemetry.identify_packet #1877

Merged
merged 1 commit into from
Feb 7, 2025

Conversation

badrobit
Copy link
Contributor

@badrobit badrobit commented Feb 5, 2025

The method was attempting to iterate over target_packets using tuple unpacking, but .items() was missing from the dict iteration. This would cause a TypeError since Python dictionaries require .items() for key-value pair iteration.

Changed:
for _, packet in target_packets:
to:
for _, packet in target_packets.items():

This ensures proper dictionary key-value pair iteration when identifying packets in tlm_unique_id_mode.

The method was attempting to iterate over target_packets using tuple unpacking, but `.items()`
was missing from the dict iteration. This would cause a TypeError since Python dictionaries
require `.items()` for key-value pair iteration.

Changed:
`for _, packet in target_packets:`
to:
`for _, packet in target_packets.items():`

This ensures proper dictionary key-value pair iteration when identifying packets in tlm_unique_id_mode.
Copy link

sonarqubecloud bot commented Feb 5, 2025

Copy link

codecov bot commented Feb 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.40%. Comparing base (48a3666) to head (0066d71).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1877      +/-   ##
==========================================
- Coverage   79.40%   79.40%   -0.01%     
==========================================
  Files         523      523              
  Lines       40905    40905              
==========================================
- Hits        32482    32479       -3     
- Misses       8423     8426       +3     
Flag Coverage Δ
python 83.97% <ø> (-0.03%) ⬇️
ruby-api 48.45% <ø> (ø)
ruby-backend 82.51% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jmthomas jmthomas self-requested a review February 7, 2025 17:11
Copy link
Member

@jmthomas jmthomas left a comment

Choose a reason for hiding this comment

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

This entire file needs a test but I'll approve and do that in another PR.

@jmthomas jmthomas merged commit 346f416 into OpenC3:main Feb 7, 2025
28 of 30 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.

2 participants