pandera
pandera copied to clipboard
feat: add overload.
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.
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
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 93.29%. Comparing base (
812b2a8) to head (41d5270). Report is 190 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #1823 +/- ##
==========================================
- Coverage 94.28% 93.29% -1.00%
==========================================
Files 91 120 +29
Lines 7013 9196 +2183
==========================================
+ Hits 6612 8579 +1967
- Misses 401 617 +216
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
thanks @yassun7010 ! please be sure to run the pre-commit checks: https://pandera.readthedocs.io/en/latest/CONTRIBUTING.html#set-up-pre-commit
@cosmicBboy
OK!
pre-commit executed 🙇
@yassun7010 looks like linter is still complaining... can you try performing the lint on a python 3.11 environment?
@cosmicBboy
Thank you!
It appears that pylint does not support overload.
This writing is correct as overload, and the warning was ignored by the comment.
@yassun7010 looks like the black linter is unhappy
@cosmicBboy Sorry 🙏
I fiexed and run pre-commit run --all on Python 3.11.
Seems to be a failure in uv installation.
This appears to be a separate issue from this fix.
thanks @yassun7010, and congrats on your first contribution to pandera! 🚀