zhengruifeng opened a new pull request, #57562: URL: https://github.com/apache/spark/pull/57562
### What changes were proposed in this pull request? Replace the scalar pandas UDF mapping for NumPy `invert` on pandas-on-Spark objects with the native Spark SQL `bitwise_not` function. Add the `int64` boundary-value coverage to the existing native NumPy ufunc parity test. ### Why are the changes needed? Spark already provides a native, Spark Connect-compatible bitwise-not function. Using it removes the Python worker boundary and preserves NumPy integer results. ### Does this PR introduce _any_ user-facing change? Yes. `np.invert` now preserves its integral result type, matching NumPy, instead of using the scalar pandas UDF mapping declared with a double result type. ### How was this patch tested? - Added pandas-on-Spark parity coverage for `np.invert` using `int64` boundary values. - Ran `build/sbt -java-home /usr/lib/jvm/java-17-openjdk-amd64 -Phive package`. - Ran `JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 SPARK_TESTING=1 SPARK_PREPEND_CLASSES=1 PYSPARK_PYTHON=.venv/bin/python PYSPARK_DRIVER_PYTHON=.venv/bin/python python/run-tests --testnames pyspark.pandas.tests.test_numpy_compat`. - Ran `git diff --check`. ### 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]
