Skip to content
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

fix(utils): fix off-by-one error in how rolling window's min_periods truncates dataframe #27388

Merged
merged 3 commits into from
Mar 21, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
don't truncate Nth period for min_periods = N
  • Loading branch information
sfirke committed Mar 4, 2024
commit b5662c80bf8e991b5cd4d3dfd68d7a4b4845a394
2 changes: 1 addition & 1 deletion superset/utils/pandas_postprocessing/rolling.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,5 @@ def rolling( # pylint: disable=too-many-arguments
df_rolling = _append_columns(df, df_rolling, columns)

if min_periods:
df_rolling = df_rolling[min_periods:]
df_rolling = df_rolling[min_periods-1:]
return df_rolling
Loading