Skip to content

[SPARK-52985][PS] Raise TypeError for pandas numpy operand in comparison operators #51670

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 7 commits into from

Conversation

xinrong-meng
Copy link
Member

@xinrong-meng xinrong-meng commented Jul 25, 2025

What changes were proposed in this pull request?

Raise TypeError for pandas numpy operand in comparison operators, which otherwise silently triggers Spark errors or unexpected behavior.

We can support thos by converting them to the corresponding pandas on Spark objects with proper testing as a follow-up.

Why are the changes needed?

Raising a clear TypeError early helps users quickly understand that such types are unsupported, rather than encountering obscure Spark errors later.

Does this PR introduce any user-facing change?

Better error messages.

Previous behavior please see #51370 (comment).

How was this patch tested?

Unit tests

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

No

@xinrong-meng xinrong-meng changed the title [WIP] Exclude pandas numpy operand in __eq__ [WIP] Exclude pandas numpy operand in comparison operators Jul 28, 2025
@xinrong-meng xinrong-meng changed the title [WIP] Exclude pandas numpy operand in comparison operators [SPARK-52985][PS] Exclude pandas numpy operand in comparison operators Jul 28, 2025
@xinrong-meng xinrong-meng changed the title [SPARK-52985][PS] Exclude pandas numpy operand in comparison operators [SPARK-52985][PS] Raise TypeError for pandas numpy operand in comparison operators Jul 28, 2025
@xinrong-meng xinrong-meng marked this pull request as ready for review July 28, 2025 22:12
@xinrong-meng
Copy link
Member Author

@ueshin @HyukjinKwon @zhengruifeng may I get a review please?

@xinrong-meng
Copy link
Member Author

Merged to master thanks!

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.

2 participants