Skip to content

Commit a036b61

Browse files
committed
Remove py37 collections.abc deprecation warnings
1 parent 5f09deb commit a036b61

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
@@ -7,7 +7,8 @@
77
import time
88
import traceback
99
import warnings
10-
from collections import Mapping, OrderedDict
10+
from collections.abc import Mapping
11+
from collections import OrderedDict
1112
from functools import partial
1213

1314
import numpy as np

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

@@ -1415,7 +1416,7 @@ def _validate_indexers(self, indexers):
14151416
""" Here we make sure
14161417
+ indexer has a valid keys
14171418
+ indexer is in a valid data type
1418-
+ string indexers are cast to the appropriate date type if the
1419+
+ string indexers are cast to the appropriate date type if the
14191420
associated index is a DatetimeIndex or CFTimeIndex
14201421
"""
14211422
from .dataarray import DataArray
@@ -1998,7 +1999,7 @@ def _validate_interp_indexer(x, new_x):
19981999
'Instead got\n{}'.format(new_x))
19992000
else:
20002001
return (x, new_x)
2001-
2002+
20022003
variables = OrderedDict()
20032004
for name, var in iteritems(obj._variables):
20042005
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
@@ -7,7 +7,7 @@
77
import itertools
88
import re
99
import warnings
10-
from collections import Iterable, Mapping, MutableMapping, MutableSet
10+
from collections.abc import Iterable, Mapping, MutableMapping, MutableSet
1111

1212
import numpy as np
1313
import pandas as pd

0 commit comments

Comments
 (0)