as of ts < cutoff?A feature aggregation that accidentally includes “future” data leaks the label. SQL’s WHERE ts < cutoff makes leakage hard to introduce accidentally because the cutoff lives in the same query as the aggregation. Pair with feature-store tooling for production.
Label leakage: features computed USING rows after the label time leak. Use WHERE ts < label_ts.
Snapshot tables: features_snapshots(date) = features for that date; query as of date.
SQL templating: query(“SELECT … WHERE ts < :cutoff”) always with a cutoff.
aggregate -> WHERE ts < cutoff -> feature row
(never compute with rows after the label)
Cutoff in the same query as the aggregation. Time-leak bugs become grep-able.