-
-
Notifications
You must be signed in to change notification settings - Fork 361
Support Python 3.14 #2158
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
base: main
Are you sure you want to change the base?
Support Python 3.14 #2158
Conversation
Signed-off-by: Fridolin Glatter <[email protected]>
18a32e4 to
53af0fb
Compare
|
Some more investigation: it looks to me like https://github.com/unionai-oss/pandera/blob/main/pandera/api/function_dispatch.py#L20 is the only line adding functions to the |
The behavior under
typing-inspect was written several years ago when the introspection capabilities of the typing module itself were much worse. I haven't checked your code but it may be easier to drop use of typing-inspect and use typing directly. |
Signed-off-by: Fridolin Glatter <[email protected]>
9ecb7ec to
24e8762
Compare
|
Thanks for chiming in here :) |
|
Yes, replacing the rest will be a bit more work and refactoring. Not my decision whether that's worth doing, but in my opinion it's usually nice to minimize third-party dependencies. |
Hi there :)
This week, Python 3.14 was released. So we've been trying to check if we can support it already in the packages we maintain.
One of these attempts is iiasa/ixmp4#209, which is now running into an error with pandera/pandas. This error is also described in pandas-dev/pandas#62711 (though not originally by me and the original description doesn't mention Python 3.14). It's just that the traceback seems very similar, so it might well be related.
Either way, this is an exemplary traceback I'm seeing (full logs can be found here):
Traceback
These tests work fine with Python 3.13 (in both cases, I'm using pandas 2.3.1 and pandera 0.25.0), but they fail with Python 3.14.
Looking at the code here, I'm assuming it could be
pandera/pandera/engines/engine.py
Line 149 in 48ba659
pandera/pandera/api/extensions.py
Line 81 in 48ba659
pandera/pandera/api/base/checks.py
Line 106 in 48ba659
dtype), but I'm not sure. It's just that thedtypein the first case is coming fromtyping.get_type_hints(), which wasn't officially changed in Python 3.14, but I know that e.g. pydantic had to adjust how they handle annotations in their metaclasses because of changes in 3.14. They now use the recommended new annotationlib for that, which might be necessary here, too.I'm hoping that running the CI tests on Python 3.14, which this PR achieves, will point in the right direction and will allow you to officially support Python 3.14 :)