Skip to content

Commit 347a894

Browse files
committed
BUG: ensure consistent behavior of Index.is_all_dates (pandas-dev#19204) - improved tests, removed unnecessary imports
1 parent 61d982c commit 347a894

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

pandas/core/indexes/base.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
from pandas._libs import algos as libalgos, index as libindex, lib
1111
import pandas._libs.join as libjoin
12-
from pandas._libs.lib import is_datetime_array, no_default
12+
from pandas._libs.lib import no_default
1313
from pandas._libs.tslibs import OutOfBoundsDatetime, Timestamp
1414
from pandas._libs.tslibs.period import IncompatibleFrequency
1515
from pandas._libs.tslibs.timezones import tz_compare
@@ -26,7 +26,6 @@
2626
from pandas.core.dtypes.common import (
2727
ensure_categorical,
2828
ensure_int64,
29-
ensure_object,
3029
ensure_platform_int,
3130
is_bool,
3231
is_bool_dtype,

pandas/tests/indexes/test_base.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -1151,8 +1151,12 @@ def test_is_object(self, indices, expected):
11511151
("bool", False),
11521152
("categorical", False),
11531153
("int", False),
1154-
("datetime", True),
11551154
("float", False),
1155+
("datetime", True),
1156+
("datetime-tz", True),
1157+
("period", True),
1158+
("timedelta", True),
1159+
("empty", False),
11561160
],
11571161
indirect=["indices"],
11581162
)
@@ -1161,7 +1165,7 @@ def test_is_all_dates(self, indices, expected):
11611165

11621166
@pytest.mark.parametrize(
11631167
"index",
1164-
["datetime", "datetime-tz", "period", "timedelta", "empty"],
1168+
["datetime", "datetime-tz", "period", "timedelta"],
11651169
indirect=["index"],
11661170
)
11671171
def test_is_all_dates_consistency(self, index):

0 commit comments

Comments
 (0)