devin-petersohn opened a new pull request, #54599:
URL: https://github.com/apache/spark/pull/54599
### What changes were proposed in this pull request?
Remove the `is_ansi_mode_enabled` guard from `_is_decimal_float_mixed`
checks in `FractionalOps` so that mixing `decimal.Decimal` with float Series
always raises `TypeError`, regardless of ANSI mode.
### Why are the changes needed?
It is a bug. With ANSI mode off, `ps.Series([1.0, 2.0, 3.0]) *
decimal.Decimal("1.5")` silently computes a result, while pandas raises
`TypeError`. The correct behavior (raising `TypeError`) was only triggered when
`spark.sql.ansi.enabled=true`.
### Does this PR introduce _any_ user-facing change?
Yes, decimal-float mixed arithmetic now always raises `TypeError` (matching
pandas), even with ANSI mode disabled.
### How was this patch tested?
CI
### Was this patch authored or co-authored using generative AI tooling?
Co-authored-by: Claude Opus 4
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]