Skip to content

Check import warning #24102

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

Merged
merged 2 commits into from
Dec 5, 2018
Merged
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
4 changes: 2 additions & 2 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ fi
### CODE ###
if [[ -z "$CHECK" || "$CHECK" == "code" ]]; then

MSG='Check for modules that pandas should not import' ; echo $MSG
python -c "
MSG='Check import. No warnings, and blacklist some optional dependencies' ; echo $MSG
python -W error -c "
import sys
import pandas

Expand Down
2 changes: 2 additions & 0 deletions pandas/compat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ def lfilter(*args, **kwargs):
Hashable = collections.abc.Hashable
Iterable = collections.abc.Iterable
Mapping = collections.abc.Mapping
MutableMapping = collections.abc.MutableMapping
Sequence = collections.abc.Sequence
Sized = collections.abc.Sized
Set = collections.abc.Set
Expand Down Expand Up @@ -200,6 +201,7 @@ def get_range_parameters(data):
Hashable = collections.Hashable
Iterable = collections.Iterable
Mapping = collections.Mapping
MutableMapping = collections.MutableMapping
Sequence = collections.Sequence
Sized = collections.Sized
Set = collections.Set
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/tools/datetimes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from collections import MutableMapping
from datetime import datetime, time
from functools import partial

Expand All @@ -18,6 +17,7 @@
from pandas.core.dtypes.generic import ABCDataFrame, ABCIndexClass, ABCSeries
from pandas.core.dtypes.missing import notna

from pandas import compat
from pandas.core import algorithms


Expand Down Expand Up @@ -570,7 +570,7 @@ def to_datetime(arg, errors='raise', dayfirst=False, yearfirst=False,
from pandas import Series
values = convert_listlike(arg._values, True, format)
result = Series(values, index=arg.index, name=arg.name)
elif isinstance(arg, (ABCDataFrame, MutableMapping)):
elif isinstance(arg, (ABCDataFrame, compat.MutableMapping)):
result = _assemble_from_unit_mappings(arg, errors=errors)
elif isinstance(arg, ABCIndexClass):
cache_array = _maybe_cache(arg, format, cache, convert_listlike)
Expand Down