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: Skip non-init fields in dataclasses. #183

Merged
merged 4 commits into from
Nov 25, 2024

Conversation

pawamoy
Copy link
Contributor

@pawamoy pawamoy commented Nov 23, 2024

Closes #181.

@pawamoy
Copy link
Contributor Author

pawamoy commented Nov 23, 2024

The type-checking error could be fixed by changing the annotation of Field.metadata to Mapping, or by making an actual dict of metadata with dict(f.metadata). Or we can type-ignore it, let me know.

@DanCardin
Copy link
Owner

i'd probably dict it personally, for making a type that can be consistent across the various types.

Copy link

codecov bot commented Nov 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (23a0be3) to head (ac2a2ea).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #183   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           25        25           
  Lines         2308      2310    +2     
  Branches       500       501    +1     
=========================================
+ Hits          2308      2310    +2     

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


🚨 Try these New Features:

src/cappa/class_inspect.py Outdated Show resolved Hide resolved
src/cappa/class_inspect.py Outdated Show resolved Hide resolved
@DanCardin DanCardin merged commit de0fe5b into DanCardin:main Nov 25, 2024
10 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.

bug: Cappa tries to pass dataclass classvar as keyword argument
2 participants