Skip to content

[SPARK-52528][PS] Enable divide-by-zero for numeric mod with ANSI enabled #51219

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

xinrong-meng
Copy link
Member

@xinrong-meng xinrong-meng commented Jun 18, 2025

What changes were proposed in this pull request?

Enable divide-by-zero for numeric mod with ANSI enabled

Why are the changes needed?

Ensure pandas on Spark works well with ANSI mode on.
Part of https://issues.apache.org/jira/browse/SPARK-52169.

Does this PR introduce any user-facing change?

Yes

How was this patch tested?

Unit tests.

(dev3.10) spark (num_mod) % SPARK_ANSI_SQL_MODE=true  ./python/run-tests --python-executables=python3.10 --testnames  "pyspark.pandas.tests.computation.test_binary_ops FrameBinaryOpsTests.test_binary_operator_mod"
...
Finished test(python3.10): pyspark.pandas.tests.computation.test_binary_ops FrameBinaryOpsTests.test_binary_operator_mod (4s)
Tests passed in 4 seconds

(dev3.10) spark (num_mod) % SPARK_ANSI_SQL_MODE=true  ./python/run-tests --python-executables=python3.10 --testnames "pyspark.pandas.tests.series.test_stat SeriesStatTests.test_mod"
...
Finished test(python3.10): pyspark.pandas.tests.series.test_stat SeriesStatTests.test_mod (5s)
Tests passed in 5 seconds

(dev3.10) spark (num_mod) % SPARK_ANSI_SQL_MODE=true  ./python/run-tests --python-executables=python3.10 --testnames "pyspark.pandas.tests.test_numpy_compat NumPyCompatTests.test_np_spark_compat_frame"
...
Finished test(python3.10): pyspark.pandas.tests.test_numpy_compat NumPyCompatTests.test_np_spark_compat_frame (15s)
Tests passed in 15 seconds

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

No.

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.

1 participant