Skip to content

Conversation

@devin-petersohn
Copy link
Contributor

What changes were proposed in this pull request?

Add support for pandas.DataFrame.any axis=1

Why are the changes needed?

To support a missing API parameter

Does this PR introduce any user-facing change?

Yes, new parameter for existing API

How was this patch tested?

CI

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

No

Signed-off-by: Devin Petersohn <devin.petersohn@gmail.com>
Signed-off-by: Devin Petersohn <devin.petersohn@gmail.com>
@devin-petersohn devin-petersohn changed the title [SPARK-46165][PS] Add support for pandas.DataFrame.any axis=1 [SPARK-46165][PS] Add support for pandas.DataFrame.all axis=1 Dec 19, 2025
Signed-off-by: Devin Petersohn <devin.petersohn@gmail.com>
@devin-petersohn
Copy link
Contributor Author

@HyukjinKwon This is ready for review.

Comment on lines +11153 to +11154
# pandas treats all NA values as True in `all()`
F.lit(True),
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this depend on skipNA's value? Although I see the test works without it so I'm probably missing soemthing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought so too, and my first commit had this but the tests kept failing. Turns out that in pandas docs it says that NA values are treated as True: https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.all.html

Screenshot 2026-01-12 at 3 34 54 PM

Copy link
Contributor

@huaxingao huaxingao left a comment

Choose a reason for hiding this comment

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

LGTM

@huaxingao
Copy link
Contributor

Merged to master. Thanks @devin-petersohn for the PR! Thanks @HyukjinKwon @holdenk for the review!

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.

4 participants