Skip to content

Commit e34886b

Browse files
committed
fix 4ea83c7
1 parent 4e00523 commit e34886b

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

pandas-stubs/_typing.pyi

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,10 @@ PyArrowTimestampDtypeArg: TypeAlias = Literal[
506506
"timestamp[ns][pyarrow]",
507507
]
508508
TimestampDtypeArg: TypeAlias = (
509-
PandasTimestampDtypeArg | NumpyTimestampDtypeArg | PyArrowTimestampDtypeArg
509+
PandasTimestampDtypeArg
510+
| PandasAstypeTimestampDtypeArg
511+
| NumpyTimestampDtypeArg
512+
| PyArrowTimestampDtypeArg
510513
)
511514
# Builtin str type and its string alias
512515
BuiltinStrDtypeArg: TypeAlias = type[str] | Literal["str"]

tests/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ def get_dtype(dtype: object) -> Generator[type | str, None, None]:
250250
if isinstance(dtype, str):
251251
yield dtype
252252
elif isinstance(dtype, type):
253-
yield dtype()
253+
yield dtype() if "pandas" in str(dtype) else dtype
254254
else:
255255
for arg in get_args(dtype):
256256
yield from get_dtype(arg)

0 commit comments

Comments
 (0)