Skip to content

Commit 7899f02

Browse files
fixed some tests
1 parent 3dcf97e commit 7899f02

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

pandas/core/dtypes/dtypes.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
TYPE_CHECKING,
1717
Any,
1818
cast,
19+
List,
1920
)
2021
import warnings
2122
import zoneinfo
@@ -675,7 +676,7 @@ def _is_boolean(self) -> bool:
675676

676677
return is_bool_dtype(self.categories)
677678

678-
def _get_common_dtype(self, dtypes: list[DtypeObj]) -> DtypeObj | None:
679+
def _get_common_dtype(self, dtypes: List[DtypeObj]) -> DtypeObj | None:
679680
# check if we have all categorical dtype with identical categories
680681
if all(isinstance(x, CategoricalDtype) for x in dtypes):
681682
first = dtypes[0]
@@ -966,7 +967,7 @@ def __setstate__(self, state) -> None:
966967
self._tz = state["tz"]
967968
self._unit = state["unit"]
968969

969-
def _get_common_dtype(self, dtypes: list[DtypeObj]) -> DtypeObj | None:
970+
def _get_common_dtype(self, dtypes: List[DtypeObj]) -> DtypeObj | None:
970971
if all(isinstance(t, DatetimeTZDtype) and t.tz == self.tz for t in dtypes):
971972
np_dtype = np.max([cast(DatetimeTZDtype, t).base for t in [self, *dtypes]])
972973
unit = np.datetime_data(np_dtype)[0]
@@ -1479,7 +1480,7 @@ def __from_arrow__(self, array: pa.Array | pa.ChunkedArray) -> IntervalArray:
14791480
)
14801481
return IntervalArray._concat_same_type(results)
14811482

1482-
def _get_common_dtype(self, dtypes: list[DtypeObj]) -> DtypeObj | None:
1483+
def _get_common_dtype(self, dtypes: List[DtypeObj]) -> DtypeObj | None:
14831484
if not all(isinstance(x, IntervalDtype) for x in dtypes):
14841485
return None
14851486

@@ -1677,7 +1678,7 @@ def from_numpy_dtype(cls, dtype: np.dtype) -> BaseMaskedDtype:
16771678
else:
16781679
raise NotImplementedError(dtype)
16791680

1680-
def _get_common_dtype(self, dtypes: list[DtypeObj]) -> DtypeObj | None:
1681+
def _get_common_dtype(self, dtypes: List[DtypeObj]) -> DtypeObj | None:
16811682
# We unwrap any masked dtypes, find the common dtype we would use
16821683
# for that, then re-mask the result.
16831684
from pandas.core.dtypes.cast import find_common_type
@@ -2104,7 +2105,7 @@ def _subtype_with_str(self):
21042105
return type(self.fill_value)
21052106
return self.subtype
21062107

2107-
def _get_common_dtype(self, dtypes: list[DtypeObj]) -> DtypeObj | None:
2108+
def _get_common_dtype(self, dtypes: List[DtypeObj]) -> DtypeObj | None:
21082109
# TODO for now only handle SparseDtypes and numpy dtypes => extend
21092110
# with other compatible extension dtypes
21102111
from pandas.core.dtypes.cast import np_find_common_type
@@ -2419,7 +2420,7 @@ def _is_boolean(self) -> bool:
24192420
"""
24202421
return pa.types.is_boolean(self.pyarrow_dtype)
24212422

2422-
def _get_common_dtype(self, dtypes: list[DtypeObj]) -> DtypeObj | None:
2423+
def _get_common_dtype(self, dtypes: List[DtypeObj]) -> DtypeObj | None:
24232424
# We unwrap any masked dtypes, find the common dtype we would use
24242425
# for that, then re-mask the result.
24252426
# Mirrors BaseMaskedDtype

0 commit comments

Comments
 (0)