From 01a77e3e3a2e42bde73fd521d7c10edf26aa6ae1 Mon Sep 17 00:00:00 2001 From: faustaround Date: Wed, 18 Feb 2026 17:41:08 -0500 Subject: [PATCH] LocalDedupNode raises KeyError on timestamp_column when column is not in feature schema MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit timestamp_column is unconditionally added to sort_keys even when the column doesn't exist in the DataFrame (e.g. when the timestamp_field isn't declared in the feature view schema and gets projected away by the DAG pipeline). The adjacent created_timestamp_column already has an in df.columns guard — timestamp_column needs the same treatment. --- .../infra/compute_engines/local/nodes.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/sdk/python/feast/infra/compute_engines/local/nodes.py b/sdk/python/feast/infra/compute_engines/local/nodes.py index 985a089daae..4fec28e8287 100644 --- a/sdk/python/feast/infra/compute_engines/local/nodes.py +++ b/sdk/python/feast/infra/compute_engines/local/nodes.py @@ -192,16 +192,19 @@ def execute(self, context: ExecutionContext) -> ArrowTableValue: # Dedup strategy: sort and drop_duplicates dedup_keys = self.column_info.join_keys if dedup_keys: - sort_keys = [self.column_info.timestamp_column] + sort_keys = [] + if self.column_info.timestamp_column in df.columns: + sort_keys.append(self.column_info.timestamp_column) if ( - self.column_info.created_timestamp_column - and self.column_info.created_timestamp_column in df.columns + self.column_info.created_timestamp_column + and self.column_info.created_timestamp_column in df.columns ): - sort_keys.append(self.column_info.created_timestamp_column) - - df = self.backend.drop_duplicates( - df, keys=dedup_keys, sort_by=sort_keys, ascending=False - ) + sort_keys.append(self.column_info.created_timestamp_column) + + if sort_keys: + df = self.backend.drop_duplicates( + df, keys=dedup_keys, sort_by=sort_keys, ascending=False + ) result = self.backend.to_arrow(df) output = ArrowTableValue(result) context.node_outputs[self.name] = output