Skip to content

Commit cbfe19e

Browse files
committed
fix 4ea83c7
1 parent bd6902a commit cbfe19e

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
@@ -38,7 +38,6 @@
3838
if TYPE_CHECKING:
3939
from pandas._typing import (
4040
BooleanDtypeArg as BooleanDtypeArg,
41-
BuiltinBooleanDtypeArg as BuiltinBooleanDtypeArg,
4241
BuiltinDtypeArg as BuiltinDtypeArg,
4342
BytesDtypeArg as BytesDtypeArg,
4443
CategoryDtypeArg as CategoryDtypeArg,
@@ -692,7 +691,7 @@ def get_dtype(dtype: object) -> Generator[type | str, None, None]:
692691
if isinstance(dtype, str):
693692
yield dtype
694693
elif isinstance(dtype, type):
695-
yield dtype()
694+
yield dtype() if "pandas" in str(dtype) else dtype
696695
else:
697696
for arg in get_args(dtype):
698697
yield from get_dtype(arg)

0 commit comments

Comments
 (0)