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

   ### 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>::new()`. No signature keeps them generic and lets 
`vec![]` infer its type.
   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.
   


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