ion-elgreco opened a new issue, #875: URL: https://github.com/apache/datafusion-python/issues/875
**Is your feature request related to a problem or challenge? Please describe what you are trying to do.** Some API's feel a bit un-intuitive, I think Polars has really excelled at this area. My suggestion is we re-use some of those APIs or take some inspiration of them, changes I am proposing (I am happy to work on these areas especially with datafusion-ray becoming a thing): - [ ] - `DataFrame.cache() -> DataFrame` ===> `DataFrame.collect() -> DataFrame` - [ ] - `DataFrame.collect() -> list[pyarrow.RecordBatch]` ===> `DataFrame.to_batches() -> list[pyarrow.RecordBatch]` - [ ] - `DataFrame.join` ===> `DataFrame.join(right: DataFrame, on: str | sequence[str] | None, left_on: str | sequence[str] | None, right_on: str | sequence[str] | None` - [ ] - `DataFrame.schema -> pyarrow.Schema` ===> `DataFrame.schema -> datafusion.Schema` **We use DFSchema in rust instead of pyarrow** - [ ] - `DataFusion.unnest_columns` ===> `DataFusion.explode()` **Unnest is quite unclear here, since it moves each element of an array into a row, initially I thought unnest would unnest a struct into multiple columns** - [ ] - `DataFrame.with_column` ===> `DataFrame.with_columns` **Allow multiple inputs as exprs or key value pairs** - [ ] - `DataFrame.with_column_renamed` ===> `DataFrame.rename()` **a simple rename is clear enough and should allow a dict as input** - [ ] - `DataFrame.aggregate` ===> `DataFrame.group_by().agg()` this feels more natural coming from PySpark/Polars/Pandas Can remove these: - [ ] -` DataFrame.select_columns` already covered by `DataFrame.select` Missing APIs: - [ ] - `DataFrame.unnest()` to unnest Struct Column into multiple columns - [ ] - `DataFrame.cast` to cast on top level a single or multiple columns - [ ] - `DataFrame.drop` to drop columns, instead of writing a very verbose select - [ ] - `DataFrame.fill_null`/`fill_nan` to fill null or nan values - [ ] - `DataFrame.interpolate` interpolate values per col - [ ] - Asof join missing in df api? - [ ] - `DataFrame.head/tail` - [ ] - `DataFrame.pivot` - [ ] - `DataFrame.unpivot` Optional but useful: - [ ] - `DataFrame.with_row_idx` -- 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]
