Skip to content

Commit 25f9e98

Browse files
committed
fix 4ea83c7
1 parent 03991fe commit 25f9e98

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
@@ -505,7 +505,10 @@ PyArrowTimestampDtypeArg: TypeAlias = Literal[
505505
"timestamp[ns][pyarrow]",
506506
]
507507
TimestampDtypeArg: TypeAlias = (
508-
PandasTimestampDtypeArg | NumpyTimestampDtypeArg | PyArrowTimestampDtypeArg
508+
PandasTimestampDtypeArg
509+
| PandasAstypeTimestampDtypeArg
510+
| NumpyTimestampDtypeArg
511+
| PyArrowTimestampDtypeArg
509512
)
510513
# Builtin str type and its string alias
511514
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)