Skip to content

[SPARK-30205][PYSPARK] Import ABCs from collections.abc to remove deprecation warnings #26835

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions python/pyspark/resultiterable.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@
# limitations under the License.
#

import collections
try:
from collections.abc import Iterable
except ImportError:
from collections import Iterable
Copy link
Member

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.

Copy link
Contributor Author

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.



__all__ = ["ResultIterable"]


class ResultIterable(collections.Iterable):
class ResultIterable(Iterable):

"""
A special result iterable. This is used because the standard
Expand Down