-
Notifications
You must be signed in to change notification settings - Fork 150
minor: remove deprecated interfaces #1481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
98da313
bdf8c89
9d28c0b
1b77551
e70cd28
e6e6459
599ef60
d5283ef
2ab0698
885502b
d8d6441
07502c1
a185cfb
8f7bd79
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -175,10 +175,7 @@ it's ``Type 2`` column that are null. | |
| Aggregate Functions | ||
| ------------------- | ||
|
|
||
| You can use any :ref:`Aggregation Function<aggregation>` as a window function. Currently | ||
| aggregate functions must use the deprecated | ||
| :py:func:`datafusion.functions.window` API but this should be resolved in | ||
| DataFusion 42.0 (`Issue Link <https://github.com/apache/datafusion-python/issues/833>`_). Here | ||
| You can use any :ref:`Aggregation Function<aggregation>` as a window function. Here | ||
| is an example that shows how to compare each pokemons’s attack power with the average attack | ||
| power in its ``"Type 1"`` using the :py:func:`datafusion.functions.avg` function. | ||
|
|
||
|
|
@@ -189,10 +186,12 @@ power in its ``"Type 1"`` using the :py:func:`datafusion.functions.avg` function | |
| col('"Name"'), | ||
| col('"Attack"'), | ||
| col('"Type 1"'), | ||
| f.window("avg", [col('"Attack"')]) | ||
| .partition_by(col('"Type 1"')) | ||
| .build() | ||
| .alias("Average Attack"), | ||
| f.avg(col('"Attack"')).over( | ||
| Window( | ||
| window_frame=WindowFrame("rows", None, None), | ||
| partition_by=[col('"Type 1"')], | ||
| ) | ||
| ).alias("Average Attack"), | ||
|
Comment on lines
+189
to
+194
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think the
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The window_frame is necessary so that we get the same avg across the entire partition. Otherwise we'd need a sort on it afterwards to make sure it shows up in the "running avg" and I think using the frame is more easy to understand. But you're right about the null treatment and order_by. |
||
| ) | ||
|
|
||
| Available Functions | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strange that this is deprecated in
datafusion-pythonbut not indatafusion: https://docs.rs/datafusion/53.0.0/datafusion/dataframe/struct.DataFrame.html#method.select_columnsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we can take both arguments in select vs select_columns, we deprecated select_columns a long time ago because it's more pythonic to have just one interface.