Skip to content

time-series/gap-unsafe-lag

Pack Severity Fix Versions
Time series review warning none, edit by hand All versions

Row-counted .shift(n), .rolling(n), .diff(n), .pct_change(n), .ewm(...) without times=, and Polars .rolling_*(n) count rows rather than elapsed calendar time. When timestamps have gaps, regularize the grid first with .asfreq(...), .resample(...), or .upsample(...), or use calendar-aware freq=, time-offset windows, or .rolling_*_by(...).

Regularize the calendar grid with asfreq, resample, or upsample first, or use calendar freq=, time-offset rolling, rolling_*_by, or ewm(times=...) so missing timestamps do not shift across gaps.

See all rules in the Time series review pack.