Skip to content

Commit b3259ad

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

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
@@ -25,7 +25,6 @@
2525
)
2626
from pandas.core.dtypes.common import (
2727
ensure_int64,
28-
ensure_object,
2928
ensure_platform_int,
3029
is_bool,
3130
is_bool_dtype,

pandas/tests/indexes/test_base.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -1152,8 +1152,12 @@ def test_is_object(self, indices, expected):
11521152
("bool", False),
11531153
("categorical", False),
11541154
("int", False),
1155-
("datetime", True),
11561155
("float", False),
1156+
("datetime", True),
1157+
("datetime-tz", True),
1158+
("period", True),
1159+
("timedelta", True),
1160+
("empty", False),
11571161
],
11581162
indirect=["indices"],
11591163
)
@@ -1162,7 +1166,7 @@ def test_is_all_dates(self, indices, expected):
11621166

11631167
@pytest.mark.parametrize(
11641168
"index",
1165-
["datetime", "datetime-tz", "period", "timedelta", "empty"],
1169+
["datetime", "datetime-tz", "period", "timedelta"],
11661170
indirect=["index"],
11671171
)
11681172
def test_is_all_dates_consistency(self, index):

0 commit comments

Comments
 (0)