Skip to content

Commit

Permalink
Guard against IntegerArray + cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
topper-123 committed Feb 2, 2019
1 parent c8bc02c commit 42b4e7c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions pandas/core/algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -1724,9 +1724,9 @@ def func(arr, indexer, out, fill_value=np.nan):
return out


# ---- #
# ------------ #
# searchsorted #
# ---- #
# ------------ #

def searchsorted(arr, value, side="left", sorter=None):
"""
Expand Down Expand Up @@ -1774,7 +1774,7 @@ def searchsorted(arr, value, side="left", sorter=None):
if sorter is not None:
sorter = ensure_platform_int(sorter)

if is_integer_dtype(arr) and (
if isinstance(arr, np.ndarray) and is_integer_dtype(arr) and (
is_integer(value) or is_integer_dtype(value)):
from .arrays.array_ import array
# if `arr` and `value` have different dtypes, `arr` would be
Expand Down
3 changes: 1 addition & 2 deletions pandas/core/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import numpy as np

from pandas._libs import lib, tslibs
import pandas.compat as compat
from pandas.compat import PY36, OrderedDict, iteritems

from pandas.core.dtypes.cast import construct_1d_object_array_from_listlike
Expand All @@ -21,8 +22,6 @@
from pandas.core.dtypes.inference import _iterable_not_string
from pandas.core.dtypes.missing import isna, isnull, notnull # noqa

from pandas import compat


class SettingWithCopyError(ValueError):
pass
Expand Down

0 comments on commit 42b4e7c

Please sign in to comment.