Skip to content

Comments

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

Closed
sfc-gh-dpetersohn wants to merge 1 commit intoapache:masterfrom
devin-petersohn:devin/fix-bool-string-comparison
Closed

[SPARK-54665][PS] Fix boolean vs string comparison to match pandas behavior#54451
sfc-gh-dpetersohn wants to merge 1 commit intoapache:masterfrom
devin-petersohn:devin/fix-bool-string-comparison

Conversation

@sfc-gh-dpetersohn
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

…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>
Copy link
Contributor

@devin-petersohn devin-petersohn left a comment

Choose a reason for hiding this comment

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

I also changed ne even though it was not on the original bug report because the behavior was also broken.

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