Closed rchui closed 2 years ago
Hi @rchui thanks for filing this issue! This should have been addressed in https://github.com/pandera-dev/pandera/pull/686.
I reproduced the issue on 0.8.0
tag, and it isn't a problem on master
.
I'll be releasing a bugfix release by next week (a pre-2022 holiday 🎁 !)
Also as a head up, 0.8.1
will be making the mypy static-linting support optional with a pip install pandera[mypy]
extra and mypy plugin. It turns out the pandas-stubs
dependency raises a fair number of false positives so we decided to make mypy support experimental.
As a heads up here's the updated docs: https://pandera--701.org.readthedocs.build/en/701/mypy_integration.html#mypy-integration.
In the mean time you can try out master
and see if it addresses the issue.
Thank you. I'm looking forward to this. Closing this issue.
Describe the bug When mypy is run with the setting (
implicit_reexport = False
), mypy will fail when pandera is used as the documentation recommends.Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.
Code Sample, a copy-pastable example
And can be type checked with
Expected behavior
The pandera base init file (
pandera/__init__.py
) uses implicit re-exports which means that instead we must import pandera classes instead like:If the expectation is that if pandera is imported like
import pandera as pa
, then top level classes and function should be explicitly re-exported.This would have no impact on users who don't use mypy and those who do allow implicit re-exports. But for those who want stricter type safety, it would allow the library to be used as intended.
Desktop (please complete the following information):
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.