Skip to content

Commit 52c8d9a

Browse files
fralalondeAlice Berard
authored and
Alice Berard
committed
[AIRFLOW-3009] Import Hashable from collection.abc to fix Python 3.7 deprecation warning (apache#3849)
1 parent e33407f commit 52c8d9a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

airflow/models.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,13 @@
2626

2727
from builtins import str, object, bytes, ImportError as BuiltinImportError
2828
import copy
29-
from collections import namedtuple, defaultdict, Hashable
29+
from collections import namedtuple, defaultdict
30+
try:
31+
# Fix Python > 3.7 deprecation
32+
from collections.abc import Hashable
33+
except ImportError:
34+
# Preserve Python < 3.3 compatibility
35+
from collections import Hashable
3036
from datetime import timedelta
3137

3238
import dill

0 commit comments

Comments
 (0)