Skip to content

Conversation

@dustinbleile
Copy link
Contributor

Changes to eliminate mypy errors and allow type checking

@codecov-commenter
Copy link

codecov-commenter commented Nov 15, 2025

Codecov Report

❌ Patch coverage is 67.34694% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.36%. Comparing base (5e018b2) to head (4261381).

Files with missing lines Patch % Lines
pori_python/ipr/annotate.py 26.66% 11 Missing ⚠️
pori_python/graphkb/match.py 50.00% 2 Missing ⚠️
pori_python/ipr/main.py 0.00% 2 Missing ⚠️
pori_python/ipr/ipr.py 90.00% 1 Missing ⚠️

❌ Your patch status has failed because the patch coverage (67.34%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop      #81      +/-   ##
===========================================
+ Coverage    83.10%   83.36%   +0.26%     
===========================================
  Files           18       18              
  Lines         2438     2441       +3     
===========================================
+ Hits          2026     2035       +9     
+ Misses         412      406       -6     
Flag Coverage Δ
unittests 83.36% <67.34%> (+0.26%) ⬆️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

variants: List[IprExprVariant],
show_progress: bool = False,
) -> List[KbMatch]:
) -> List[Hashabledict]:
Copy link
Member

Choose a reason for hiding this comment

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

Why these need to be hashable? We're loosing all the structure of KbMatch.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hashabledict is used for dropping duplicates from a list (convert to set).

The function seems to be used in exactly one place and immediately converted to a hashable type.

Ideally, I would have liked to just make KbMatch a hashable dict type, but I couldn't figure that out here. If someone can figure that out, I think that is the appropriate solution.

I was just trying to something that gave the appropriate mypy warnings and didn't create errors from any of the KbMatch duplicates.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think probably best to preserve KbMatch structure; will take a crack at making kbmatch a hashable dict type.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think probably best to preserve KbMatch structure; will take a crack at making kbmatch a hashable dict type.

Hi @elewis2, are you having any luck with this?

I think we will want to start with these changes regardless and add extra typing details as we can.
It's more important that the parts where structure is given is accurate than the fact that it is lost at some point. At least this way the mypy warnings are accurate.

The other way to keep the KbMatch structure would be to refactor to eliminate the Hashabledict all together. If I understand it was only used to drop duplicates. I think you could eliminate the Hashabledict by creating functions that can take lists of kbMatches and drop duplicates.

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.

5 participants