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

feat: add overload. #1823

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

yassun7010
Copy link

@yassun7010 yassun7010 commented Sep 30, 2024

Using the latest pylance, pa.Int, etc. will result in an error.

This is because Callable[[_DataTypeClass], _DataTypeClass]] can now be correctly parsed and Callable is now a function and not a class.
Defining override avoids problems in many cases, such as pa.Int.

image

English Message is here.

Class is required, but received “_DataTypeClass[Unknown] | ((_DataTypeClass[Unknown]) -> _DataTypeClass[Unknown])”
  “(_DataTypeClass[Unknown]) -> _DataTypeClass[Unknown]” is not a class

Python 3.11.0
pylance v2024.9.2
pandas 2.2.2

Signed-off-by: yassun7010 <[email protected]>
Copy link

codecov bot commented Sep 30, 2024

Codecov Report

Attention: Patch coverage is 71.42857% with 2 lines in your changes missing coverage. Please review.

Project coverage is 93.20%. Comparing base (812b2a8) to head (62073f4).
Report is 151 commits behind head on main.

Files with missing lines Patch % Lines
pandera/dtypes.py 71.42% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1823      +/-   ##
==========================================
- Coverage   94.28%   93.20%   -1.09%     
==========================================
  Files          91      120      +29     
  Lines        7013     9207    +2194     
==========================================
+ Hits         6612     8581    +1969     
- Misses        401      626     +225     

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

@cosmicBboy
Copy link
Collaborator

thanks @yassun7010 ! please be sure to run the pre-commit checks: https://pandera.readthedocs.io/en/latest/CONTRIBUTING.html#set-up-pre-commit

Signed-off-by: yassun7010 <[email protected]>
@yassun7010
Copy link
Author

yassun7010 commented Oct 1, 2024

@cosmicBboy

OK!

pre-commit executed 🙇

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.

2 participants