HyukjinKwon opened a new pull request, #840:
URL: https://github.com/apache/spark-connect-rust/pull/840
### What changes were proposed in this pull request?
A follow-up of #795 (af083d7d). That change removed arrow's `prettyprint`
and the unused `tokio-stream` dependency so that the crates do not pull in, and
the wheels do not link, code that they do not use. The default features of
tonic are the same kind of code.
**1. tonic is the client only.**
- The workspace dependency `tonic = { version = "0.14" }` turned on tonic's
defaults: `transport`, which includes `server`, `router` (axum) and `codegen`.
Every crate that depends on tonic inherits it: proto, core, pyspark-rs, and
apache-spark-connect's dev-dependency.
- No shipped code uses tonic's server. Every `tonic::server` and
`transport::Server` is in a test: the `#[cfg(test)]` module of
`spark-connect-core/src/client.rs`, or the `tests/` directories of the core and
of apache-spark-connect.
- The shipped code uses `transport::{Endpoint, Channel, Certificate,
ClientTlsConfig}`, which `channel` provides.
- The generated code uses `codegen`. proto's `build.rs` builds no server.
- pyspark-rs uses `tonic::Streaming` only.
- The workspace dependency is now `default-features = false, features =
["channel", "codegen"]`. The core and apache-spark-connect enable `server` and
`router` in their dev-dependencies, for the gRPC servers of their tests.
- The wheel's tree loses five crates, and `LICENSE-binary` loses their
entries, regenerated with `scripts/gen_binary_licenses.py`. `NOTICE-binary` is
unchanged. The five crates:
- axum 0.8.9;
- axum-core 0.5.6;
- matchit 0.8.4;
- mime 0.3.17;
- httpdate 1.0.3.
The published crates' users no longer compile them either. tokio-stream
stays, as tonic depends on it unconditionally.
**2. base64 0.22 in apache-spark-connect.** The core moved to `base64 =
"0.22"` in #657 (SPARK-61773), which tonic builds anyway. apache-spark-connect
still declared 0.21 for its `wasm-udf` feature and its tests. A `wasm-udf`
build compiled 0.21.7 for it alone. Its uses compile unchanged on 0.22:
- `base64::Engine as _` and `general_purpose::STANDARD.encode`, in
`wasm_udf.rs`;
- the same in the tests, `ml.rs` and
`ml/classification_api/tree/golden_tests.rs`.
0.21.7 leaves `Cargo.lock`.
**3. The core's dev-dependency `hyper-util = { version = "0.1", features =
["tokio"] }` is removed.** Its normal dependency has `["client-legacy",
"tokio"]` since #769 (SPARK-61847). That covers the
`hyper_util::rt::TokioExecutor` and `TokioIo` of the tests.
### Why are the changes needed?
So that the published crates and the wheels build and link only the code
that they use, and so that `LICENSE-binary` lists only what the wheels bundle.
### Does this PR introduce _any_ user-facing change?
No behavior changes.
- A user of the published crates compiles tonic without its server and
router: axum, axum-core, matchit, mime and httpdate are no longer dependencies.
- A program that uses tonic's server itself enables it in its own dependency
on tonic, as before.
### How was this patch tested?
- **cargo check of the feature combinations that CI uses**, `--locked`:
- non-test builds, where tonic is the client only: `--workspace`, which
includes pyspark-rs and `examples`;
- the five published crates with `apache-spark-connect/wasm-udf`, the
crates and features of rust.yml's MSRV step, on stable as 1.88 is not installed
here;
- `-p examples --bin wasm_udf_macro --features examples/wasm-udf-macro`;
- test builds, with the dev-dependencies' server and router: `--workspace
--all-targets`, `-p apache-spark-connect --all-targets`, with `--features
wasm-udf`, and with `--features datafusion,polars`, and `-p
apache-spark-connect-macros --all-targets`;
- the crates that the workspace excludes, through their manifests:
`examples/wasm-udfs`, `examples/wasm-udf-inline` and `tests/wasm-udf`.
`tests/wasm-udf-wasi` needs the `wasm32-wasip1` target, which is not installed
here.
- `cargo test -p apache-spark-connect-core --release`, whose tests run their
own gRPC servers: 240 unit tests and the integration tests passed.
- `cargo test -p pyspark-rs --lib`, linked as rust.yml links it.
- `cargo tree --locked -e normal,no-proc-macro -p pyspark-rs`: exactly the
five crates above leave the tree.
- `python3 scripts/gen_binary_licenses.py --check`: up to date.
- `cargo package --list --allow-dirty` of the five published crates, as
release.yml runs it: each has its LICENSE and NOTICE.
- `cargo package --no-verify` of proto, core and apache-spark-connect
normalizes tonic to `default-features = false` and `["channel", "codegen"]`,
with the core's TLS features.
- The dev-dependencies add `server` and `router`.
- **Lint:**
- `cargo fmt --all --check`;
- `cargo +1.100.0 clippy -p apache-spark-connect-core -p
apache-spark-connect -p pyspark-rs --all-targets -- -D warnings`;
- `RUSTDOCFLAGS="-D warnings" cargo doc --no-deps -p apache-spark-connect
-p apache-spark-connect-core`.
### 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]