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

   ### What changes were proposed in this pull request?
   
   This PR replaces the pandas UDF implementation of `np.float_power` in pandas 
API on Spark with native Spark `pow`, casting both operands to `double`. It 
also adds compatibility coverage for integral inputs and floating-point special 
values.
   
   ### Why are the changes needed?
   
   Using a native Spark expression avoids pandas UDF and Arrow overhead while 
preserving NumPy `float_power` floating-point semantics.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   Added `test_np_float_power`, covering integral inputs, signed zero, 
infinities, and NaN.
   
   - `ruff check python/pyspark/pandas/numpy_compat.py 
python/pyspark/pandas/tests/test_numpy_compat.py`
   - `ruff format --check python/pyspark/pandas/numpy_compat.py 
python/pyspark/pandas/tests/test_numpy_compat.py`
   - `python/run-tests --testnames pyspark.pandas.tests.test_numpy_compat` 
(`test_np_float_power` passed; the module has two unrelated existing reciprocal 
pandas-UDF failures due to a local Python/JVM class-signature mismatch.)
   
   ### 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: [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]

Reply via email to