You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "zhengruifeng (via GitHub)" <gi...@apache.org> on 2026/08/05 03:22:09 UTC

[PR] [SPARK-58580][PS] Use native Spark function for NumPy ldexp [spark]

zhengruifeng opened a new pull request, #57780:
URL: https://github.com/apache/spark/pull/57780

   ### What changes were proposed in this pull request?
   
   Replaces the pandas UDF used for `np.ldexp` in the pandas API on Spark with the native Spark SQL expression `x * pow(2.0, exp)`.
   
   Adds coverage for finite values, infinities, NaN, signed zero, and exponent overflow and underflow.
   
   ### Why are the changes needed?
   
   Using native Spark expressions avoids pandas UDF serialization and lets Spark optimize and code-generate this operation while preserving NumPy-compatible behavior.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No. This is a behavior-preserving implementation change.
   
   ### How was this patch tested?
   
   `source ~/.zshrc && conda run -n spark-dev-313 python/run-tests --testnames pyspark.pandas.tests.test_numpy_compat.NumPyCompatTests.test_np_ldexp`
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Codex (GPT-5)


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-58580][PS] Use native Spark function for NumPy ldexp [spark]

Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng closed pull request #57780: [SPARK-58580][PS] Use native Spark function for NumPy ldexp
URL: https://github.com/apache/spark/pull/57780


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-58580][PS] Use native Spark function for NumPy ldexp [spark]

Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng commented on PR #57780:
URL: https://github.com/apache/spark/pull/57780#issuecomment-5188532415

   **Merge Summary:**
   - merged into master https://github.com/apache/spark/commit/fdd586ef0c903e5b5616813a2f1bb24a03ef7886
   - merged into branch-4.x https://github.com/apache/spark/commit/30f46bffb2c72c9a31fb3f7494f5be253ffd1a5c
   
   *Posted by `merge_spark_pr.py`*


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org