Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

[SPARK-62655][PYTHON] Handle non-finite Decimal values in DataFrame comparisons - #61202

Open
umrndem wants to merge 1 commit into
apache:masterfrom
umrndem:fix/SPARK-62655-decimal-nonfinite
Open

umrndem wants to merge 1 commit into
apache:masterfrom
umrndem:fix/SPARK-62655-decimal-nonfinite

Conversation

@umrndem

@umrndem umrndem commented Dec 5, 2026

Copy link
Copy Markdown

What changes were proposed in this pull request?

Handle Decimal NaNs and infinities before applying the tolerance calculation in assertDataFrameEqual. Also handle infinity comparisons in the pandas path, as suggested on SPARK-62655.

Why are the changes needed?

Decimal NaNs currently raise InvalidOperation, while some comparisons involving infinity incorrectly pass. For example, Decimal("1") and Decimal("Infinity") can be treated as equal.

Does this PR introduce any user-facing change?

Yes. The comparison helper accepts matching NaNs and same-sign infinities, and reports an assertion failure for mismatched non-finite values.

How was this patch tested?

Extended the non-finite regression tests to cover Decimal values, nested values and pandas DataFrames. Confirmed the regressions fail before the fix.

Passed:

  • build/sbt -Phive package
  • python/run-tests --parallelism 1 --python-executables="$PWD/.venv/bin/python3" --testnames pyspark.sql.tests.test_utils (86 tests, no skips)
  • dev/lint-python --ruff --compile

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

Generated-by: OpenAI Codex (GPT-6)

This branch has not been deployed

No deployments
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