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

Sort dna dict #870

Closed
wants to merge 2 commits into from
Closed

Sort dna dict #870

wants to merge 2 commits into from

Conversation

oussamaessaji
Copy link
Member

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.

@oussamaessaji oussamaessaji requested a review from a team as a code owner February 25, 2025 10:50
Returns:
A sorted dictionary or list.
"""
if isinstance(dictionary, dict):
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if isinstance(dictionary, dict):
if isinstance(dictionary, dict) is True:

Copy link
Member

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):
Copy link
Contributor

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:

@oussamaessaji oussamaessaji deleted the feature/sort-dna-dict branch February 25, 2025 10:54
Copy link

codecov bot commented Feb 25, 2025

Codecov Report

Attention: Patch coverage is 95.45455% with 1 line in your changes missing coverage. Please review.

Project coverage is 62.57%. Comparing base (13f66e1) to head (7c9cfb9).

Files with missing lines Patch % Lines
...b/agent/mixins/agent_report_vulnerability_mixin.py 92.30% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

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.

4 participants