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 the error when inspect the typing annotations #177

Merged
merged 2 commits into from
Jul 19, 2024

Conversation

superstar54
Copy link
Member

Fix #175

The previous code has the assumption that all type hints which have an origin attribute also possess an _name attribute. This is not true for certain built-in generic types like list, dict, etc. in Python, particularly when accessed via the origin attribute, which is a legacy of Python's type hinting evolution.

The previous code has the assumption that all type hints which have an __origin__ attribute also possess an _name attribute. This is not true for certain built-in generic types like list, dict, etc. in Python, particularly when accessed via the __origin__ attribute, which is a legacy of Python's type hinting evolution.
@codecov-commenter
Copy link

codecov-commenter commented Jul 17, 2024

Codecov Report

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

Project coverage is 76.07%. Comparing base (24c9239) to head (a24f271).
Report is 2 commits behind head on main.

Files Patch % Lines
tests/test_python.py 87.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #177      +/-   ##
==========================================
+ Coverage   75.80%   76.07%   +0.27%     
==========================================
  Files          69       70       +1     
  Lines        4608     4724     +116     
==========================================
+ Hits         3493     3594     +101     
- Misses       1115     1130      +15     
Flag Coverage Δ
python-3.11 75.97% <90.00%> (+0.25%) ⬆️
python-3.9 76.06% <90.00%> (+0.27%) ⬆️

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.

@superstar54 superstar54 merged commit 8941227 into main Jul 19, 2024
11 checks passed
@superstar54 superstar54 deleted the fix/175/inspect_imports branch July 19, 2024 14:26
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.

Failed to get required imports for function
2 participants