Skip to content

Commit 12f69d4

Browse files
committed
Remove py37 collections.abc deprecation warnings
1 parent 9d572a5 commit 12f69d4

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

xarray/backends/common.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
import time
55
import traceback
66
import warnings
7-
from collections import Mapping, OrderedDict
7+
from collections.abc import Mapping
8+
from collections import OrderedDict
89

910
import numpy as np
1011

xarray/core/dataset.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
import functools
44
import sys
55
import warnings
6-
from collections import Mapping, defaultdict
6+
from collections import defaultdict
7+
from collections.abc import Mapping
78
from distutils.version import LooseVersion
89
from numbers import Number
910

@@ -1380,7 +1381,7 @@ def _validate_indexers(self, indexers):
13801381
""" Here we make sure
13811382
+ indexer has a valid keys
13821383
+ indexer is in a valid data type
1383-
+ string indexers are cast to the appropriate date type if the
1384+
+ string indexers are cast to the appropriate date type if the
13841385
associated index is a DatetimeIndex or CFTimeIndex
13851386
"""
13861387
from .dataarray import DataArray
@@ -1963,7 +1964,7 @@ def _validate_interp_indexer(x, new_x):
19631964
'Instead got\n{}'.format(new_x))
19641965
else:
19651966
return (x, new_x)
1966-
1967+
19671968
variables = OrderedDict()
19681969
for name, var in iteritems(obj._variables):
19691970
if name not in indexers:

xarray/core/indexing.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
import functools
44
import operator
5-
from collections import Hashable, defaultdict
5+
from collections.abc import Hashable
6+
from collections import defaultdict
67
from datetime import timedelta
78

89
import numpy as np

xarray/core/missing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import absolute_import, division, print_function
22

33
import warnings
4-
from collections import Iterable
4+
from collections.abc import Iterable
55
from functools import partial
66

77
import numpy as np

xarray/core/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import os.path
99
import re
1010
import warnings
11-
from collections import Iterable, Mapping, MutableMapping, MutableSet
11+
from collections.abc import Iterable, Mapping, MutableMapping, MutableSet
1212

1313
import numpy as np
1414
import pandas as pd

0 commit comments

Comments
 (0)