File tree 3 files changed +6
-4
lines changed
3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 45
45
# other
46
46
47
47
Dtype = Union [str , np .dtype , "ExtensionDtype" ]
48
+ DtypeObj = Union [np .dtype , "ExtensionDtype" ]
48
49
FilePathOrBuffer = Union [str , Path , IO [AnyStr ]]
49
50
50
51
# FrameOrSeriesUnion means either a DataFrame or a Series. E.g.
Original file line number Diff line number Diff line change 6
6
7
7
from pandas ._libs import algos , lib
8
8
from pandas ._libs .tslibs import conversion
9
- from pandas ._typing import ArrayLike
9
+ from pandas ._typing import ArrayLike , DtypeObj
10
10
11
11
from pandas .core .dtypes .dtypes import (
12
12
CategoricalDtype ,
@@ -1668,7 +1668,7 @@ def _is_dtype(arr_or_dtype, condition) -> bool:
1668
1668
return condition (dtype )
1669
1669
1670
1670
1671
- def _get_dtype (arr_or_dtype ):
1671
+ def _get_dtype (arr_or_dtype ) -> DtypeObj :
1672
1672
"""
1673
1673
Get the dtype instance associated with an array
1674
1674
or dtype object.
@@ -1840,7 +1840,7 @@ def _validate_date_like_dtype(dtype) -> None:
1840
1840
)
1841
1841
1842
1842
1843
- def pandas_dtype (dtype ):
1843
+ def pandas_dtype (dtype ) -> DtypeObj :
1844
1844
"""
1845
1845
Convert input into a pandas only dtype object or a numpy dtype object.
1846
1846
Original file line number Diff line number Diff line change 8
8
from pandas ._libs import lib
9
9
import pandas ._libs .missing as libmissing
10
10
from pandas ._libs .tslibs import NaT , iNaT
11
+ from pandas ._typing import DtypeObj
11
12
12
13
from pandas .core .dtypes .common import (
13
14
_NS_DTYPE ,
@@ -585,7 +586,7 @@ def remove_na_arraylike(arr):
585
586
return arr [notna (lib .values_from_object (arr ))]
586
587
587
588
588
- def is_valid_nat_for_dtype (obj , dtype ) -> bool :
589
+ def is_valid_nat_for_dtype (obj , dtype : DtypeObj ) -> bool :
589
590
"""
590
591
isna check that excludes incompatible dtypes
591
592
You can’t perform that action at this time.
0 commit comments