HyukjinKwon opened a new pull request, #763:
URL: https://github.com/apache/spark-connect-rust/pull/763

   ### What changes were proposed in this pull request?
   
   Declare the minimum pandas, PyArrow and NumPy of `pyspark-client` 4.3.0, and 
its `pyyaml` dependency, in `pyspark-client-rust`:
   
   | | before | after (as `pyspark-client` 4.3.0) |
   |---|---|---|
   | pandas | `>=1.0.0` | `>=2.2.0` |
   | pyarrow | `>=10.0.0` | `>=18.0.0` |
   | numpy | `>=1.16.0` | `>=1.23.2` |
   | pyyaml | not declared | `>=3.11` |
   
   The versions are those of `python/packaging/client/setup.py` at Apache Spark 
v4.3.0. Its gRPC dependencies (grpcio, grpcio-status, googleapis-common-protos, 
zstandard) stay out, as the Rust transport replaces them. The notes in 
`docs/compatibility.md` and `dev/design/architecture.md` that described the old 
declarations are updated, and the CI step that runs the live-server tests in an 
environment of only the drop-in's dependencies installs pyyaml too.
   
   ### Why are the changes needed?
   
   The old declarations let pip build environments where the vendored PySpark 
4.3.0 code fails at runtime:
   
   - `pyspark/sql/pandas/utils.py` (vendored) requires pandas 2.2.0 and PyArrow 
18.0.0. With pyarrow 17.0.0, which `pyarrow>=10.0.0` allows, `pandas_udf` 
raises `[UNSUPPORTED_PACKAGE_VERSION] PyArrow >= 18.0.0 must be installed; 
however, your version is 17.0.0.` With pandas 2.1.4, pip picks numpy 1.26.4, 
under which PyArrow 26 cannot be imported, so `toPandas`, `toArrow`, 
`createDataFrame` of a pandas DataFrame and `pyspark.ml` fail, and `pandas_udf` 
raises `Pandas >= 2.2.0 must be installed`.
   - The vendored Spark Declarative Pipelines CLI (`pyspark/pipelines/cli.py`) 
imports `yaml`, so in a clean install `python -m pyspark.pipelines.cli` fails 
with `ModuleNotFoundError: No module named 'yaml'`. `pyspark-client` declares 
`pyyaml`.
   
   The package metadata of a release cannot be changed once it is on PyPI, so 
this is better fixed before 4.3.0.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. pip now installs pyyaml with `pyspark-client-rust`, and refuses 
environments with pandas below 2.2.0, PyArrow below 18.0.0 or NumPy below 
1.23.2, as it does for `pyspark-client` 4.3.0.
   
   ### How was this patch tested?
   
   Built the wheel of this branch with `maturin build --release --locked` and 
checked its metadata (`Requires-Dist: pandas>=2.2.0`, `pyarrow>=18.0.0`, 
`numpy>=1.23.2`, `pyyaml>=3.11`). In a clean Python 3.11 virtualenv with only 
that wheel, pip installed PyYAML 6.0.3, `python -m pyspark.pipelines.cli 
--help` works, and `pip check` reports pandas 2.1.4 as incompatible. The 
failures above were reproduced with the 4.3.0 wheel of master against a Spark 
4.3.0 Connect server.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Opus 5.5
   
   This pull request and its description were written by Isaac.
   


-- 
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