Skip to content

[SPARK-54665][PS] Fix boolean vs string comparison to match pandas behavior#54456

Open
devin-petersohn wants to merge 3 commits intoapache:masterfrom
devin-petersohn:devin/fix-bool-string-comparison
Open

[SPARK-54665][PS] Fix boolean vs string comparison to match pandas behavior#54456
devin-petersohn wants to merge 3 commits intoapache:masterfrom
devin-petersohn:devin/fix-bool-string-comparison

Conversation

@devin-petersohn
Copy link
Contributor

What changes were proposed in this pull request?

Move the _should_return_all_false type-mismatch check outside the ANSI mode guard in DataTypeOps.eq/ne and NumericOps.eq/ne so it runs regardless of spark.sql.ansi.enabled.

Why are the changes needed?

It is a bug, boolean vs string comparison doesn't match pandas behavior when ANSI mode is off.

Does this PR introduce any user-facing change?

Yes, fix the bug

How was this patch tested?

CI

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

Co-authored-by: Claude Opus 4

devin-petersohn and others added 3 commits February 24, 2026 09:35
…havior

Move _should_return_all_false type-mismatch check outside the ANSI mode
guard in DataTypeOps.eq/ne and NumericOps.eq/ne so it always enforces
pandas semantics regardless of spark.sql.ansi.enabled setting.

Co-authored-by: Devin Petersohn <devin.petersohn@snowflake.com>
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>
@HyukjinKwon
Copy link
Member

cc @ueshin @gaogaotiantian FYI

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants