Spenserrrr opened a new pull request, #58651: URL: https://github.com/apache/spark/pull/58651
### What changes were proposed in this pull request? Adds a golden-file test under `python/pyspark/tests/upstream/numpy/` recording the dtype NumPy coerces each operand to, for every ufunc pandas-on-Spark dispatches. Rows are the ufuncs in `numpy_compat.py`'s dispatch mappings (one row per operand position for binary ones), columns the operand dtype, and each cell the coerced output dtype or `ERR@<exception class>` where NumPy refused. It takes no Spark session. ### Why are the changes needed? `_np_spark_accepted_types` was transcribed by hand from what NumPy accepts, and nothing verifies it: `dev/requirements.txt` requires `numpy>=1.23.2` with no upper bound, so a release that moves a coercion leaves the gate over-rejecting or under-rejecting silently. The transcription is already version-sensitive — `np.ceil` on an `int8` returns `float16` on numpy 2.0 but `int8` from 2.1 on. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? New golden test, swept across numpy 2.0.0 through 2.4.6 (only 2.0.x differs, in 19 cells, carried as version-guarded overrides) and confirmed to skip on the 1.23.2 minimum-dependency pin. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code (Claude Opus 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]
