Skip to content

Commit

Permalink
docs(python): warn that "by" argument must be sorted for results to b…
Browse files Browse the repository at this point in the history
…e correct in rolling_* functions (#11013)
  • Loading branch information
MarcoGorelli authored Sep 10, 2023
1 parent 67c7d7d commit 0f37edf
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions py-polars/polars/expr/expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -5345,6 +5345,10 @@ def rolling_min(
If the `window_size` is temporal for instance `"5h"` or `"3s"`, you must
set the column that will be used to determine the windows. This column must
be of dtype Datetime.
.. warning::
If passed, the column must be sorted in ascending order. Otherwise,
results will not be correct.
closed : {'left', 'right', 'both', 'none'}
Define which sides of the temporal interval are closed (inclusive); only
applicable if `by` has been set.
Expand Down Expand Up @@ -5784,6 +5788,10 @@ def rolling_mean(
If the `window_size` is temporal for instance `"5h"` or `"3s"`, you must
set the column that will be used to determine the windows. This column must
be of dtype Datetime.
.. warning::
If passed, the column must be sorted in ascending order. Otherwise,
results will not be correct.
closed : {'left', 'right', 'both', 'none'}
Define which sides of the temporal interval are closed (inclusive); only
applicable if `by` has been set.
Expand Down Expand Up @@ -6247,6 +6255,10 @@ def rolling_std(
If the `window_size` is temporal for instance `"5h"` or `"3s"`, you must
set the column that will be used to determine the windows. This column must
be of dtype Datetime.
.. warning::
If passed, the column must be sorted in ascending order. Otherwise,
results will not be correct.
closed : {'left', 'right', 'both', 'none'}
Define which sides of the temporal interval are closed (inclusive); only
applicable if `by` has been set.
Expand Down Expand Up @@ -6479,6 +6491,10 @@ def rolling_var(
If the `window_size` is temporal for instance `"5h"` or `"3s"`, you must
set the column that will be used to determine the windows. This column must
be of dtype Datetime.
.. warning::
If passed, the column must be sorted in ascending order. Otherwise,
results will not be correct.
closed : {'left', 'right', 'both', 'none'}
Define which sides of the temporal interval are closed (inclusive); only
applicable if `by` has been set.
Expand Down Expand Up @@ -6716,6 +6732,10 @@ def rolling_median(
If the `window_size` is temporal for instance `"5h"` or `"3s"`, you must
set the column that will be used to determine the windows. This column must
be of dtype Datetime.
.. warning::
If passed, the column must be sorted in ascending order. Otherwise,
results will not be correct.
closed : {'left', 'right', 'both', 'none'}
Define which sides of the temporal interval are closed (inclusive); only
applicable if `by` has been set.
Expand Down Expand Up @@ -6877,6 +6897,10 @@ def rolling_quantile(
If the `window_size` is temporal for instance `"5h"` or `"3s"`, you must
set the column that will be used to determine the windows. This column must
be of dtype Datetime.
.. warning::
If passed, the column must be sorted in ascending order. Otherwise,
results will not be correct.
closed : {'left', 'right', 'both', 'none'}
Define which sides of the temporal interval are closed (inclusive); only
applicable if `by` has been set.
Expand Down

0 comments on commit 0f37edf

Please sign in to comment.