Skip to content

Use collections.abc for ABC import to fix Python 3.9 compatibility. #33

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
merged 2 commits into from
Feb 11, 2020
Merged

Use collections.abc for ABC import to fix Python 3.9 compatibility. #33

merged 2 commits into from
Feb 11, 2020

Conversation

tirkarthi
Copy link
Contributor

@tirkarthi tirkarthi commented Dec 7, 2019

Importing ABC from collections module will raise ImportError in Python 3.9 and raises DeprecationWarning from 3.4 . Hence use collections.abc and also preserve compatibility with Python 2. Ref : python/cpython#10596

@savingoyal
Copy link
Collaborator

Thanks for the PR! Much appreciated! Please refer to the contributing guide. We are aligning internally on how to make contributing to Metaflow easy and transparent.

Copy link
Contributor

@romain-intel romain-intel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tiny change to make it just a tad better. Thanks for the PR.

@@ -4,7 +4,10 @@
import time
from hashlib import sha1
from functools import partial
from collections import Sequence
try:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, Sequence does not seem to be used anywhere in this file so maybe we can just remove the line and no add anything :).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I just did a find and replace. Removed the unused import now.

@@ -11,7 +10,10 @@
from urlparse import urlparse
except:
from urllib.parse import urlparse

try:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect :)

@savingoyal
Copy link
Collaborator

@tirkarthi Can you resolve the conflicts on this patch so that we can merge it.

@savingoyal savingoyal merged commit 3cec380 into Netflix:master Feb 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants