Skip to content

Commit e3a90db

Browse files
committed
fix 4ea83c7
1 parent 4b86a0b commit e3a90db

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

pandas-stubs/_typing.pyi

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,10 @@ PyArrowTimestampDtypeArg: TypeAlias = Literal[
504504
"timestamp[ns][pyarrow]",
505505
]
506506
TimestampDtypeArg: TypeAlias = (
507-
PandasTimestampDtypeArg | NumpyTimestampDtypeArg | PyArrowTimestampDtypeArg
507+
PandasTimestampDtypeArg
508+
| PandasAstypeTimestampDtypeArg
509+
| NumpyTimestampDtypeArg
510+
| PyArrowTimestampDtypeArg
508511
)
509512
# Builtin str type and its string alias
510513
BuiltinStrDtypeArg: TypeAlias = type[str] | Literal["str"]

tests/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
if TYPE_CHECKING:
3434
from pandas._typing import (
3535
BooleanDtypeArg as BooleanDtypeArg,
36-
BuiltinBooleanDtypeArg as BuiltinBooleanDtypeArg,
3736
BuiltinDtypeArg as BuiltinDtypeArg,
3837
BytesDtypeArg as BytesDtypeArg,
3938
CategoryDtypeArg as CategoryDtypeArg,
@@ -683,7 +682,7 @@ def get_dtype(dtype: object) -> Generator[type | str, None, None]:
683682
if isinstance(dtype, str):
684683
yield dtype
685684
elif isinstance(dtype, type):
686-
yield dtype()
685+
yield dtype() if "pandas" in str(dtype) else dtype
687686
else:
688687
for arg in get_args(dtype):
689688
yield from get_dtype(arg)

0 commit comments

Comments
 (0)