Skip to content

Commit 722f1f0

Browse files
committed
fix 4ea83c7
1 parent 4044eb0 commit 722f1f0

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
@@ -34,7 +34,6 @@
3434
if TYPE_CHECKING:
3535
from pandas._typing import (
3636
BooleanDtypeArg as BooleanDtypeArg,
37-
BuiltinBooleanDtypeArg as BuiltinBooleanDtypeArg,
3837
BuiltinDtypeArg as BuiltinDtypeArg,
3938
BytesDtypeArg as BytesDtypeArg,
4039
CategoryDtypeArg as CategoryDtypeArg,
@@ -681,7 +680,7 @@ def get_dtype(dtype: object) -> Generator[type | str, None, None]:
681680
if isinstance(dtype, str):
682681
yield dtype
683682
elif isinstance(dtype, type):
684-
yield dtype()
683+
yield dtype() if "pandas" in str(dtype) else dtype
685684
else:
686685
for arg in get_args(dtype):
687686
yield from get_dtype(arg)

0 commit comments

Comments
 (0)