This is an automated email from the ASF dual-hosted git repository.

HyukjinKwon pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark-connect-rust.git


The following commit(s) were added to refs/heads/master by this push:
     new 48a50ff7 [SPARK-61603][FOLLOWUP][CONNECT][DOCS] Document the 
empty-literal break of select_expr and summary, and the Option exceptions of 
the column-list sweep
48a50ff7 is described below

commit 48a50ff7dde991224d8a476310ed738381df7176
Author: Hyukjin Kwon <[email protected]>
AuthorDate: Fri Nov 13 16:08:05 2026 +0900

    [SPARK-61603][FOLLOWUP][CONNECT][DOCS] Document the empty-literal break of 
select_expr and summary, and the Option exceptions of the column-list sweep
    
    ### What changes were proposed in this pull request?
    
    This follows up #613, which made more column-list and name-list arguments 
of the Rust API take any iterable. A post-merge review found three things that 
the sweep paragraph of `docs/compatibility.md` did not say. This PR documents 
them, with no code change:
    
    1. **The empty-literal break.** In v4.2.0, `select_expr` and `summary` took 
a `Vec<&str>`, so `df.summary(vec![])` compiled; it was the way to ask for the 
default statistics. They now take any iterable, so an untyped `vec![]` gives 
E0283 ("type annotations needed"). #613's description says that every existing 
caller compiles as before, which is not true for this case. The paragraph now 
names the two methods, and `load_paths`, which v4.2.0 did not have, with the 
typed form `Vec::<&str> [...]
    2. **`drop_duplicates` and `drop_duplicates_within_watermark`.** They still 
take `Option<Vec<&str>>`, as in v4.2.0, so `drop_duplicates(Some(["id"]))` does 
not compile. Making them generic would break `None`, as it would for the other 
`Option<Vec<&str>>` arguments. They are now listed with those exceptions: the 
null functions' `subset` and `melt`'s `value_vars`.
    3. **`unpivot`'s `None`.** The optional `values` of `unpivot` already took 
any iterable in v4.2.0, so `unpivot(["id"], None, "v", "val")` never compiled, 
while `melt(["id"], None, ..)` does. Changing the signature would break today's 
`Some(["a"])` callers. The paragraph now says to pass `None::<Vec<Column>>` or 
`None::<[&str; 0]>`.
    
    ### Why are the changes needed?
    
    So that Rust users upgrading from v4.2.0 know which calls need a type 
annotation, and why.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No. Documentation only.
    
    ### How was this patch tested?
    
    - I checked the v4.2.0 signatures at the tag.
    - A scratch test, not committed, compiles every form that the paragraph 
gives: `summary(Vec::<&str>::new())`, `select_expr(Vec::<&str>::new())`, 
`unpivot(["id"], None::<Vec<Column>>, ..)`, `unpivot(["id"], None::<[&str; 0]>, 
..)`, `melt(vec!["id"], None, ..)`, `drop_duplicates(None)` and 
`drop_duplicates_within_watermark(Some(vec!["id"]))`.
    
    ### 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.
    
    Closes #627 from HyukjinKwon/SPARK-61603-followup-sweep-docs.
    
    Authored-by: Hyukjin Kwon <[email protected]>
    Signed-off-by: Hyukjin Kwon <[email protected]>
---
 docs/compatibility.md | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/docs/compatibility.md b/docs/compatibility.md
index 4b8a7771..fcb1f62a 100644
--- a/docs/compatibility.md
+++ b/docs/compatibility.md
@@ -48,8 +48,15 @@ aggregate methods took still compiles, by the new 
`From<Expression> for Column`,
 `Vec<SortOrder>` of the `order_by` of a window, by `From<SortOrder> for 
Column`; there a Column
 that is not a sort order is sorted ascending, nulls first, as PySpark's 
`WindowSpec.orderBy` sorts
 it. An empty `vec![]` or `[]` has no item type to infer: pass 
`Vec::<Column>::new()` or
-`Vec::<&str>::new()` instead. The optional `subset` arguments of the null 
functions, and the
-optional `value_vars` of `melt`, stay `Option<Vec<&str>>`, so that `None` 
still infers its type.
+`Vec::<&str>::new()` instead. This breaks a caller of v4.2.0 that passes an 
empty literal to
+`select_expr` or `summary`, which took a `Vec<&str>` there: 
`df.summary(vec![])`, for the default
+statistics, becomes `df.summary(Vec::<&str>::new())`. The same goes for 
`load_paths`. The optional
+`subset` arguments of the null functions, the optional `value_vars` of `melt` 
and the optional
+`column_names` of `drop_duplicates` and `drop_duplicates_within_watermark` stay
+`Option<Vec<&str>>`, as in v4.2.0, so that `None` still infers its type. The 
optional `values` of
+`unpivot` takes any iterable, as in v4.2.0, so its `None` has no item type to 
infer, unlike that
+of `melt`: pass `None::<Vec<Column>>` or `None::<[&str; 0]>` to unpivot every 
column that is not
+an id.
 
 `BinaryClassificationEvaluator::set_score_col` and `score_col`, and the Python
 `scoreCol=` argument and `setScoreCol` of v4.2.0 are removed, without an alias:


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to