Skip to content

Commit 102b82a

Browse files
ohad83jreback
authored andcommitted
Revert "CLN - Better way to import from collections.abc"
This reverts commit 5fe4140. Apparently it's an unwanted pattern checked for by code_checks.sh (from collections.abc import)
1 parent e536b4d commit 102b82a

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

pandas/core/base.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
Base and utility classes for pandas objects.
33
"""
44
import builtins
5-
from collections import OrderedDict
6-
from collections.abc import Mapping
5+
from collections import OrderedDict, abc
76
import textwrap
87
from typing import Dict, FrozenSet, List, Optional
98

@@ -1109,7 +1108,7 @@ def _map_values(self, mapper, na_action=None):
11091108
# we can fastpath dict/Series to an efficient map
11101109
# as we know that we are not going to have to yield
11111110
# python types
1112-
if isinstance(mapper, Mapping):
1111+
if isinstance(mapper, abc.Mapping):
11131112
if isinstance(mapper, dict) and hasattr(mapper, "__missing__"):
11141113
# If a dictionary subclass defines a default value method,
11151114
# convert mapper to a lookup function (GH #15999).

pandas/core/series.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
Data structure for 1-dimensional cross-sectional and time series data
33
"""
4-
from collections.abc import Mapping
4+
from collections import abc
55
from io import StringIO
66
from shutil import get_terminal_size
77
from textwrap import dedent
@@ -252,7 +252,7 @@ def __init__(
252252
else:
253253
data = data.reindex(index, copy=copy)
254254
data = data._data
255-
elif isinstance(data, Mapping):
255+
elif isinstance(data, abc.Mapping):
256256
data, index = self._init_dict(data, index, dtype)
257257
dtype = None
258258
copy = False
@@ -3515,7 +3515,7 @@ def map(self, arg, na_action=None):
35153515
35163516
Parameters
35173517
----------
3518-
arg : function, collections.abc.Mapping subclass or Series
3518+
arg : function, colletions.abc.Mapping subclass or Series
35193519
Mapping correspondence.
35203520
na_action : {None, 'ignore'}, default None
35213521
If 'ignore', propagate NaN values, without passing them to the

0 commit comments

Comments
 (0)