Description
Weird, using v1.5.3.230227, which has that, I got this message
error: Argument 1 to "astype" of "DataFrame" has incompatible type "Literal['category']"; expected "Union[Union[Union[Type[bool], Type[bool_], BooleanDtype, Literal['bool']], Union[Type[int], Int8Dtype, Int16Dtype, Int32Dtype, Int64Dtype, Type[signedinteger[_8Bit]], Type[signedinteger[_16Bit]], Type[signedinteger[_32Bit]], Type[signedinteger[_64Bit]], Type[unsignedinteger[_8Bit]], Type[unsignedinteger[_16Bit]], Type[unsignedinteger[_32Bit]], Type[unsignedinteger[_64Bit]], Type[signedinteger[Any]], Type[unsignedinteger[Any]], Type[signedinteger[Any]], Type[unsignedinteger[Any]], Literal['int', 'int32']], Union[Type[str], StringDtype, Literal['str']], Type[bytes], Union[Float32Dtype, Float64Dtype, Type[floating[_16Bit]], Type[floating[_32Bit]], Type[floating[_64Bit]], Type[float], Literal['float']], Union[Type[complexfloating[_32Bit, _32Bit]], Type[complexfloating[_64Bit, _64Bit]], Type[complex], Literal['complex']], CategoricalDtype, ExtensionDtype, Literal['timedelta64[ns]', 'datetime64[ns]']], Mapping[Any, Union[ExtensionDtype, Union[str, dtype[generic], Type[str], Type[complex], Type[bool], Type[object]]]], Series[Any]]" [arg-type]
I guess because CategoryDtypeArg
is missing from AstypeArg
.
pandas-stubs/pandas-stubs/_typing.pyi
Lines 153 to 164 in d2faa7f
Originally posted by @zmoon in #556 (comment)