Skip to content

[SPARK-46166][PS] Implementation of pandas.DataFrame.any with axis=None#53478

Closed
devin-petersohn wants to merge 7 commits into
apache:masterfrom
devin-petersohn:devin/any_axis_none
Closed

[SPARK-46166][PS] Implementation of pandas.DataFrame.any with axis=None#53478
devin-petersohn wants to merge 7 commits into
apache:masterfrom
devin-petersohn:devin/any_axis_none

Conversation

@devin-petersohn

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Support for axis=None in pandas.DataFrame.any.

Why are the changes needed?

New API

Does this PR introduce any user-facing change?

New parameter support for an existing API.

How was this patch tested?

CI / local

Was this patch authored or co-authored using generative AI tooling?

No

devin-petersohn and others added 2 commits December 15, 2025 14:47
Signed-off-by: Devin Petersohn <devin.petersohn@gmail.com>
Co-authored-by: Devin Petersohn <devin.petersohn@snowflake.com>
Signed-off-by: Devin Petersohn <devin.petersohn@gmail.com>

@allisonwang-db allisonwang-db left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread python/pyspark/pandas/frame.py Outdated
axis: Optional[Axis] = 0,
bool_only: Optional[bool] = None,
skipna: bool = True,
**kwargs: Any,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems kwargs are not used/passed in the PR, and don't have a test for it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kwargs are only there for numpy compatibility and do not change behavior. From pandas and the docstring in this PR:

**kwargs: Any, default None
            Additional keywords have no effect but might be accepted for compatibility with
            NumPy.

Do we need a test for it?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot find an example with kwargs in https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.any.html,
not sure how it works in pandas.

But in PS, I prefer not adding it if it doesn't take effect.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM, removed kwargs (it is ignored in pandas).

Signed-off-by: Devin Petersohn <devin.petersohn@gmail.com>
Signed-off-by: Devin Petersohn <devin.petersohn@gmail.com>
Signed-off-by: Devin Petersohn <devin.petersohn@gmail.com>
Signed-off-by: Devin Petersohn <devin.petersohn@gmail.com>
Signed-off-by: Devin Petersohn <devin.petersohn@gmail.com>
@HyukjinKwon

Copy link
Copy Markdown
Member

Merged to master.

@wilmerdooley

Copy link
Copy Markdown

I opened #56623 to address this. The details are in the PR; happy to adjust based on what you'd prefer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants