Visitar URL original
feat: Add opt-in filter_by_created_timestamp cutoff to get_historical_features by addenergyx · Pull Request #6617 · feast-dev/feast · GitHub
Skip to content
Merged
Show file tree
Hide file tree
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
Prev Previous commit
Next Next commit
chore: Trim comments to the non-obvious constraints
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: David <david-adeniji@hotmail.co.uk>
  • Loading branch information
addenergyx and claude committed Jul 21, 2026
commit 6d1cf1d553129fec2e2e1fbfa19d3051ccd73206
8 changes: 3 additions & 5 deletions sdk/python/feast/infra/offline_stores/dask.py
Original file line number Diff line number Diff line change
Expand Up @@ -1200,11 +1200,9 @@ def _filter_created_timestamp(
created_timestamp_column: str,
entity_df_event_timestamp_col: str,
) -> dd.DataFrame:
# Only keep feature values that were already created as of the entity event
# timestamp. Rows without a timestamp are unmatched entity rows from the
# left join and are kept; feature rows with a null created timestamp are
# excluded, consistent with the SQL predicate. Returned lazily so the mask
# fuses into the following _drop_duplicates persist.
# timestamp_field is NaN only for unmatched entity rows from the left join,
# which must be kept; null created timestamps fail the comparison and are
# excluded, matching the SQL predicate. Kept lazy to fuse into the next persist.
return df_to_join[
df_to_join[timestamp_field].isna()
| (
Expand Down
5 changes: 2 additions & 3 deletions sdk/python/feast/infra/offline_stores/snowflake.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,8 @@ def get_historical_features(
project: str,
full_feature_names: bool = False,
) -> RetrievalJob:
# filter_by_created_timestamp is not supported: the ASOF JOIN used for
# point-in-time retrieval cannot express a created_timestamp cutoff
# (supports_filter_by_created_timestamp stays False).
# supports_filter_by_created_timestamp stays False: the ASOF JOIN cannot
# express a created_timestamp cutoff.
assert isinstance(config.offline_store, SnowflakeOfflineStoreConfig)
for fv in feature_views:
assert isinstance(fv.batch_source, SnowflakeSource)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1005,8 +1005,7 @@ def test_historical_features_filter_by_created_timestamp(environment):

store.apply([driver, driver_fv])

# By default the backfilled values win the dedup, even though they were
# created after the entity timestamp
# Default: the backfilled values win the dedup
actual_df = store.get_historical_features(
entity_df=entity_df,
features=["driver_stats:avg_daily_trips"],
Expand All @@ -1020,8 +1019,6 @@ def test_historical_features_filter_by_created_timestamp(environment):
)
validate_dataframes(expected_df, actual_df, sort_by=["driver_id"])

# With filter_by_created_timestamp=True only values created at or before the entity
# timestamp are served
try:
job = store.get_historical_features(
entity_df=entity_df,
Expand Down