-
Notifications
You must be signed in to change notification settings - Fork 184
FIX remove __annotate_func__ that return __dict__ within a closure Python 3.14 #578
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
Merged
+32
−0
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
glemaitre
commented
Oct 31, 2025
ogrisel
reviewed
Oct 31, 2025
Contributor
|
Please also document the change in the changelog. |
ogrisel
approved these changes
Oct 31, 2025
Contributor
ogrisel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much @glemaitre!
dongjoon-hyun
added a commit
to apache/spark
that referenced
this pull request
Nov 10, 2025
### What changes were proposed in this pull request? This PR aims to upgrade `cloudpickle` to 3.1.2. ### Why are the changes needed? To support Python 3.14 properly. - https://github.com/cloudpipe/cloudpickle/releases/tag/v3.1.2 - https://github.com/cloudpipe/cloudpickle/blob/master/CHANGES.md#312 > Fix pickling of abstract base classes containing type annotations for Python 3.14. (cloudpipe/cloudpickle#578) ### Does this PR introduce _any_ user-facing change? No, Python 3.14 support is not announced yet. ### How was this patch tested? Pass the CIs. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #52964 from dongjoon-hyun/SPARK-54269. Authored-by: Dongjoon Hyun <dongjoon@apache.org> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
dongjoon-hyun
added a commit
to apache/spark
that referenced
this pull request
Nov 10, 2025
### What changes were proposed in this pull request? This PR aims to upgrade `cloudpickle` to 3.1.2. ### Why are the changes needed? To support Python 3.14 properly. - https://github.com/cloudpipe/cloudpickle/releases/tag/v3.1.2 - https://github.com/cloudpipe/cloudpickle/blob/master/CHANGES.md#312 > Fix pickling of abstract base classes containing type annotations for Python 3.14. (cloudpipe/cloudpickle#578) ### Does this PR introduce _any_ user-facing change? No, Python 3.14 support is not announced yet. ### How was this patch tested? Pass the CIs. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #52964 from dongjoon-hyun/SPARK-54269. Authored-by: Dongjoon Hyun <dongjoon@apache.org> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org> (cherry picked from commit 9754e17) Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
zifeif2
pushed a commit
to zifeif2/spark
that referenced
this pull request
Nov 22, 2025
### What changes were proposed in this pull request? This PR aims to upgrade `cloudpickle` to 3.1.2. ### Why are the changes needed? To support Python 3.14 properly. - https://github.com/cloudpipe/cloudpickle/releases/tag/v3.1.2 - https://github.com/cloudpipe/cloudpickle/blob/master/CHANGES.md#312 > Fix pickling of abstract base classes containing type annotations for Python 3.14. (cloudpipe/cloudpickle#578) ### Does this PR introduce _any_ user-facing change? No, Python 3.14 support is not announced yet. ### How was this patch tested? Pass the CIs. ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#52964 from dongjoon-hyun/SPARK-54269. Authored-by: Dongjoon Hyun <dongjoon@apache.org> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
huangxiaopingRD
pushed a commit
to huangxiaopingRD/spark
that referenced
this pull request
Nov 25, 2025
### What changes were proposed in this pull request? This PR aims to upgrade `cloudpickle` to 3.1.2. ### Why are the changes needed? To support Python 3.14 properly. - https://github.com/cloudpipe/cloudpickle/releases/tag/v3.1.2 - https://github.com/cloudpipe/cloudpickle/blob/master/CHANGES.md#312 > Fix pickling of abstract base classes containing type annotations for Python 3.14. (cloudpipe/cloudpickle#578) ### Does this PR introduce _any_ user-facing change? No, Python 3.14 support is not announced yet. ### How was this patch tested? Pass the CIs. ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#52964 from dongjoon-hyun/SPARK-54269. Authored-by: Dongjoon Hyun <dongjoon@apache.org> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes #572
Python 3.14 implements PEP649 and PEP749. The idea of those is to have a lazy evaluation of the annotation such that the evaluation happen after that the types are defined.
It means that the class
__dict__does not contain anymore the__annotations__attribute (dict containing the annotations) but instead an__annotate_func__attribute referring to a function called__annotate__that when evaluated contains a reference the class__dict__as mentioned in python/cpython#140820 (comment).By reading the PEPs, it looks at when unserializing it will recreate the
__annotate_func__attribute.