pandera
pandera copied to clipboard
Type hints are not retained
Describe the bug Basic use case of static model class does not retain its type checking after enforcement
- [x] I have checked that this issue has not already been reported.
- [x] I have confirmed this bug exists on the latest version of pandera.
Expected behavior
Typing should be retained Columns can be auto-completed
Desktop:
- VSCode
- Pylance
Screenshots
I cannot replicate this (with pandera 0.18.0
and pandas 2.2.0
), so I guess it is not related to pandera but to your environment and VS Code setup.
@schatimo That's somehow reassuring. What language server are you using, I'm on pylance but I've read mypy is better integrated?
Also, I'm not getting column suggestions:
And the infered type is unknown:
Is it behaving like this in your setup?
I'm on the same librairy version too, so it's definitely a VSCode setup thing: pandas==2.2.0 pandera==0.18.0
Do you have additionnal editor settings?
I use Pylance, yes, but mypy for static type checking (as I do not use pyright which comes with Pylance but is disabled by default if I recall correctly). I have a couple of settings in VS Code. So, I would close the issue as it is unrelated to pandera and not a bug but related to your settings.
Go ahead, but I'd love to get some more directions on how to enable those type hints properly