Skip to content

Commit 586e2c7

Browse files
committed
use is_period_dtype to check type
1 parent 5cb5cf9 commit 586e2c7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pandas/core/dtypes/cast.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
from pandas._libs.tslibs import (
2424
NaT,
2525
OutOfBoundsDatetime,
26-
Period,
2726
Timedelta,
2827
Timestamp,
2928
conversion,
@@ -63,6 +62,7 @@
6362
is_integer_dtype,
6463
is_numeric_dtype,
6564
is_object_dtype,
65+
is_period_dtype,
6666
is_scalar,
6767
is_sparse,
6868
is_string_dtype,
@@ -188,7 +188,7 @@ def maybe_downcast_to_dtype(result, dtype: Dtype):
188188
else:
189189
result = result.astype(dtype)
190190

191-
elif dtype.type is Period:
191+
elif is_period_dtype(dtype):
192192
# TODO(DatetimeArray): merge with previous elif
193193
from pandas.core.arrays import PeriodArray
194194

0 commit comments

Comments
 (0)