Skip to content

Remove py37 collections.abc deprecation warnings #2574

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
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion xarray/backends/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
import time
import traceback
import warnings
from collections import Mapping, OrderedDict
from collections.abc import Mapping
from collections import OrderedDict

import numpy as np

Expand Down
7 changes: 4 additions & 3 deletions xarray/core/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
import functools
import sys
import warnings
from collections import Mapping, defaultdict
from collections import defaultdict
from collections.abc import Mapping
from distutils.version import LooseVersion
from numbers import Number

Expand Down Expand Up @@ -1380,7 +1381,7 @@ def _validate_indexers(self, indexers):
""" Here we make sure
+ indexer has a valid keys
+ indexer is in a valid data type
+ string indexers are cast to the appropriate date type if the
+ string indexers are cast to the appropriate date type if the
associated index is a DatetimeIndex or CFTimeIndex
"""
from .dataarray import DataArray
Expand Down Expand Up @@ -1963,7 +1964,7 @@ def _validate_interp_indexer(x, new_x):
'Instead got\n{}'.format(new_x))
else:
return (x, new_x)

variables = OrderedDict()
for name, var in iteritems(obj._variables):
if name not in indexers:
Expand Down
3 changes: 2 additions & 1 deletion xarray/core/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

import functools
import operator
from collections import Hashable, defaultdict
from collections.abc import Hashable
from collections import defaultdict
from datetime import timedelta

import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion xarray/core/missing.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import absolute_import, division, print_function

import warnings
from collections import Iterable
from collections.abc import Iterable
from functools import partial

import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion xarray/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import os.path
import re
import warnings
from collections import Iterable, Mapping, MutableMapping, MutableSet
from collections.abc import Iterable, Mapping, MutableMapping, MutableSet

import numpy as np
import pandas as pd
Expand Down