Skip to content

Commit 7f643d6

Browse files
committed
remove overload defs and define function any in sub-classes
1 parent 076efc0 commit 7f643d6

File tree

3 files changed

+28
-34
lines changed

3 files changed

+28
-34
lines changed

pandas/core/frame.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8642,6 +8642,19 @@ def aggregate(self, func=None, axis: Axis = 0, *args, **kwargs):
86428642

86438643
agg = aggregate
86448644

8645+
@doc(NDFrame.any, **_shared_doc_kwargs)
8646+
def any(
8647+
self: DataFrame,
8648+
axis: Axis = 0,
8649+
bool_only: bool | None = None,
8650+
skipna: bool = True,
8651+
level: Level | None = None,
8652+
**kwargs,
8653+
) -> Series:
8654+
return super().any(
8655+
axis=axis, bool_only=bool_only, skipna=skipna, level=level, **kwargs
8656+
)
8657+
86458658
@doc(
86468659
_shared_docs["transform"],
86478660
klass=_shared_doc_kwargs["klass"],

pandas/core/generic.py

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -10358,47 +10358,14 @@ def _logical_func(
1035810358
filter_type="bool",
1035910359
)
1036010360

10361-
@overload
10362-
def any(
10363-
self: DataFrame,
10364-
axis: Axis = ...,
10365-
bool_only: bool_t | None = ...,
10366-
skipna: bool_t = ...,
10367-
level: Level | None = ...,
10368-
**kwargs,
10369-
) -> Series:
10370-
...
10371-
10372-
@overload
10373-
def any(
10374-
self: Series,
10375-
axis: Axis = ...,
10376-
bool_only: bool_t | None = ...,
10377-
skipna: bool_t = ...,
10378-
level: Level | None = ...,
10379-
**kwargs,
10380-
) -> bool_t:
10381-
...
10382-
10383-
@overload
10384-
def any(
10385-
self: NDFrame,
10386-
axis: Axis = ...,
10387-
bool_only: bool_t | None = ...,
10388-
skipna: bool_t = ...,
10389-
level: Level | None = ...,
10390-
**kwargs,
10391-
) -> Series | bool_t:
10392-
...
10393-
1039410361
def any(
1039510362
self,
1039610363
axis: Axis = 0,
1039710364
bool_only: bool_t | None = None,
1039810365
skipna: bool_t = True,
1039910366
level: Level | None = None,
1040010367
**kwargs,
10401-
) -> Series | bool_t:
10368+
):
1040210369
return self._logical_func(
1040310370
"any", nanops.nanany, axis, bool_only, skipna, level, **kwargs
1040410371
)

pandas/core/series.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
DtypeObj,
4040
FillnaOptions,
4141
IndexKeyFunc,
42+
Level,
4243
SingleManager,
4344
StorageOptions,
4445
TimedeltaConvertibleTypes,
@@ -4257,6 +4258,19 @@ def aggregate(self, func=None, axis=0, *args, **kwargs):
42574258

42584259
agg = aggregate
42594260

4261+
@doc(NDFrame.any, **_shared_doc_kwargs)
4262+
def any(
4263+
self: Series,
4264+
axis: Axis = 0,
4265+
bool_only: bool | None = None,
4266+
skipna: bool = True,
4267+
level: Level | None = None,
4268+
**kwargs,
4269+
) -> bool:
4270+
return super().any(
4271+
axis=axis, bool_only=bool_only, skipna=skipna, level=level, **kwargs
4272+
)
4273+
42604274
@doc(
42614275
_shared_docs["transform"],
42624276
klass=_shared_doc_kwargs["klass"],

0 commit comments

Comments
 (0)