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

   ### What changes were proposed in this pull request?
   
   Part 2 of the column-list sweep of the Rust API (part 1: SPARK-61600). The 
remaining list-taking methods take any iterable, as `select` and `group_by` do, 
with #590's patterns: `C: Into<Column>` for columns and `S: Into<String>` for 
names.
   
   - Columns: `DataFrame::drop_columns` (both lists), `with_columns` 
(name/Column pairs), `grouping_sets`, `grouping_sets_with_columns`, 
`TableValuedFunction::udtf`, `functions::count_distinct_columns`, the wasm UDF 
`to_expression`, and `DataStreamWriter::partition_by` and `cluster_by` (which 
took `Vec<&str>`).
   - Names: `DataFrame::drop`, `with_columns_renamed` (pairs), `describe`, 
`to_df`, `to_schema`, `melt` (`id_vars`), the numeric aggregates of 
`GroupedData`, `StatFunctions::freq_items` and `approx_quantile`, and 
`Column::drop_fields`.
   - A `columns_of` helper is added next to `expressions_of`.
   - The sweep paragraph of `docs/compatibility.md` is extended. The drop-in 
does not change behavior: eight `to_df` call sites collect into a `Vec`.
   
   The `Option<Vec<&str>>` subset arguments (`fillna*`, `dropna`, 
`drop_duplicates*`, `replace_*`, `fill`, `melt`'s `value_vars`) are unchanged, 
because a bare `None` would become ambiguous for their callers.
   
   ### Why are the changes needed?
   
   For a consistent API: before, `df.drop(["temp_col"])` did not compile 
("expected Vec<&str>, found [&str; 1]"), and only a `Vec` was taken. After, 
arrays, Vecs and iterators all compile and build the same plan.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes, in the Rust API: these methods take any iterable. Callers that pass a 
`Vec` or an array need no change. A caller that passes an empty `vec![]` or 
`[]` needs its item type (`Vec::<Column>::new()`), as the compatibility docs 
note.
   
   ### How was this patch tested?
   
   - Unit tests compare the plan protos of the array, Vec and iterator forms, 
and fail to compile against the old signatures. 
`list_methods_take_any_iterable_as_their_vec_does` covers the DataFrame 
methods, plus tests for `drop_fields`, `udtf`, the stream writer and the wasm 
`to_expression`.
   - e2e: `list_methods_take_any_iterable_on_the_server`.
   - On the branch, against Spark 4.3.0:
     - The full spark-connect integration suite: 1012 passed.
     - The doc snippet checker: 56 snippets.
     - CI's offline Python set: 3273 passed.
     - `test_dropin_e2e.py`: 275 passed.
   - On the tree merged with the latest master: the lib tests (656 and 220), 
the `--no-run` builds with and without `wasm-udf`, the pyspark-rs and examples 
builds, `cargo fmt`, and the new e2e test.
   
   ### 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