Skip to content

[SPARK-58469][PS] Use native expressions for NumPy rint - #57672

Draft
zhengruifeng wants to merge 1 commit into
apache:masterfrom
zhengruifeng:pandas-native-rint-dev2
Draft

[SPARK-58469][PS] Use native expressions for NumPy rint#57672
zhengruifeng wants to merge 1 commit into
apache:masterfrom
zhengruifeng:pandas-native-rint-dev2

Conversation

@zhengruifeng

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Replace the pandas UDF mapping for NumPy rint on pandas-on-Spark objects with the native Spark rint expression after casting the input to double. Add coverage for halfway values, signed zero, NaN, and infinities.

Why are the changes needed?

The operation can be evaluated by Spark without crossing the Python worker boundary while preserving the existing double result type.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

  • Added parity coverage in NumPyCompatTests.test_np_math_functions.
  • Passed Ruff format and lint checks for the changed Python files.
  • Focused PySpark tests were not run locally.

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

Generated-by: Codex (GPT-5)

@zhengruifeng
zhengruifeng marked this pull request as draft July 31, 2026 12:31
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.

1 participant