Skip to content

Commit eb6ffa6

Browse files
author
Laurent Mutricy
committed
adding tests for select_dtypes, resolves pandas-dev#887
1 parent 96ec420 commit eb6ffa6

File tree

1 file changed

+31
-3
lines changed

1 file changed

+31
-3
lines changed

pandas-stubs/core/frame.pyi

+31-3
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ from pandas.core.window.rolling import (
5050
Rolling,
5151
Window,
5252
)
53-
from typing_extensions import Self
53+
from typing_extensions import (
54+
Self,
55+
TypeAlias,
56+
)
5457
import xarray as xr
5558

5659
from pandas._libs.lib import NoDefault
@@ -608,10 +611,35 @@ class DataFrame(NDFrame, OpsMixin):
608611
self, expr: _str, *, inplace: Literal[False] = ..., **kwargs
609612
) -> DataFrame: ...
610613
def eval(self, expr: _str, *, inplace: _bool = ..., **kwargs): ...
614+
AstypeArgExt: TypeAlias = (
615+
AstypeArg
616+
| Literal[
617+
"number",
618+
"datetime64",
619+
"datetime",
620+
"timedelta",
621+
"timedelta64",
622+
"datetimetz",
623+
"datetime64[ns]",
624+
]
625+
)
626+
AstypeArgExtList: TypeAlias = AstypeArgExt | list[AstypeArgExt]
627+
@overload
628+
def select_dtypes(
629+
self,
630+
include: AstypeArgExtList,
631+
exclude: AstypeArgExtList | None = ...,
632+
) -> DataFrame: ...
633+
@overload
634+
def select_dtypes(
635+
self,
636+
include: AstypeArgExtList | None,
637+
exclude: AstypeArgExtList,
638+
) -> DataFrame: ...
639+
@overload
611640
def select_dtypes(
612641
self,
613-
include: _str | list[_str] | None = ...,
614-
exclude: _str | list[_str] | None = ...,
642+
exclude: AstypeArgExtList,
615643
) -> DataFrame: ...
616644
def insert(
617645
self,

0 commit comments

Comments
 (0)