-
Notifications
You must be signed in to change notification settings - Fork 55
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
Sort dna dict #870
Sort dna dict #870
Conversation
Returns: | ||
A sorted dictionary or list. | ||
""" | ||
if isinstance(dictionary, dict): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if isinstance(dictionary, dict): | |
if isinstance(dictionary, dict) is True: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mypy does not accept it
""" | ||
if isinstance(dictionary, dict): | ||
return {k: _sort_dict(v) for k, v in sorted(dictionary.items())} | ||
if isinstance(dictionary, list): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if isinstance(dictionary, list) is True:
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #870 +/- ##
==========================================
+ Coverage 62.54% 62.57% +0.02%
==========================================
Files 342 342
Lines 14553 14575 +22
==========================================
+ Hits 9102 9120 +18
- Misses 5451 5455 +4 ☔ View full report in Codecov by Sentry. |
In this PR, I've added the logic to sort the DNA dictionary to unify the sorting logic in one place and remove duplicate code, so the agent does not have to handle sorting on their side.