-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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
[SPARK-30205][PYSPARK] Import ABCs from collections.abc to remove deprecation warnings #26835
Conversation
ok to test |
Test build #115107 has finished for PR 26835 at commit
|
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 for making your first PR, @tirkarthi .
However, Python 3.9
is not released yet. Can we revisit this as a single PR after Python 3.9
is officially released?
The change was meant to go as part of 3.8 but was postponed to 3.9 as noted in upstream PR due to Python ecosystem being incompatible. The PR also fixes the deprecation warning for all other versions like 3.8 and 3.7. I feel this is good enough to merge but will leave it to maintainers though. |
For the following reason, it looks worth to me, too. Thank you for the explanation.
|
I will review this again with the Python versions supported by Apache Spark. Thanks! |
Sure, thanks for the update. |
Hi, @tirkarthi . Could you check if this is the only required instance? |
I checked |
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.
+1, LGTM. Thank you for your first contribution, @tirkarthi .
Merged to master.
Thank you, @tirkarthi . (Karthikeyan Singaravelan). You are added to the Apache Spark contributor group and SPARK-30205 is assigned to you. |
Thank you :) |
try: | ||
from collections.abc import Iterable | ||
except ImportError: | ||
from collections import Iterable |
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.
I know this way is more preferred but can we do this by version-checking? That's consistent in the code base at least.
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.
Sorry, I was not aware of it.
What changes were proposed in this pull request?
This PR aims to remove deprecation warnings by importing ABCs from
collections.abc
instead ofcollections
.Why are the changes needed?
This will remove deprecation warnings in Python 3.7 and 3.8.
Does this PR introduce any user-facing change?
No, this doesn't introduce user-facing change
How was this patch tested?
Manually because this is about deprecation warning messages.