From 85ba12f712917473244f4fbc022d8635c6e357b5 Mon Sep 17 00:00:00 2001 From: Suraj Patil Date: Mon, 7 Apr 2025 00:22:54 +0530 Subject: [PATCH] fix: Dask pulling of latest data Signed-off-by: Suraj Patil --- sdk/python/feast/infra/offline_stores/dask.py | 4 ++-- sdk/python/tests/utils/feature_records.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/python/feast/infra/offline_stores/dask.py b/sdk/python/feast/infra/offline_stores/dask.py index ea857996966..87af51337dd 100644 --- a/sdk/python/feast/infra/offline_stores/dask.py +++ b/sdk/python/feast/infra/offline_stores/dask.py @@ -365,13 +365,13 @@ def evaluate_offline_job(): if start_date and end_date: source_df = source_df[ source_df[timestamp_field].between( - start_date, end_date, inclusive="left" + start_date, end_date, inclusive="both" ) ] elif start_date: source_df = source_df[source_df[timestamp_field] >= start_date] elif end_date: - source_df = source_df[source_df[timestamp_field] < end_date] + source_df = source_df[source_df[timestamp_field] <= end_date] source_df = source_df.persist() diff --git a/sdk/python/tests/utils/feature_records.py b/sdk/python/tests/utils/feature_records.py index e81666eaa50..1c844fb293d 100644 --- a/sdk/python/tests/utils/feature_records.py +++ b/sdk/python/tests/utils/feature_records.py @@ -519,7 +519,7 @@ def get_last_feature_row(df: pd.DataFrame, driver_id, max_date: datetime): """Manually extract last feature value from a dataframe for a given driver_id with up to `max_date` date""" filtered = df[ (df["driver_id"] == driver_id) - & (df["event_timestamp"] < max_date.replace(tzinfo=timezone.utc)) + & (df["event_timestamp"] <= max_date.replace(tzinfo=timezone.utc)) ] max_ts = filtered.loc[filtered["event_timestamp"].idxmax()]["event_timestamp"] filtered_by_ts = filtered[filtered["event_timestamp"] == max_ts]