diff --git a/sdk/python/feast/infra/offline_stores/file.py b/sdk/python/feast/infra/offline_stores/file.py index ffe67e804d..6bc7ef0c86 100644 --- a/sdk/python/feast/infra/offline_stores/file.py +++ b/sdk/python/feast/infra/offline_stores/file.py @@ -159,13 +159,14 @@ def pull_latest_from_table_or_query( source_df[event_timestamp_column] = source_df[event_timestamp_column].apply( lambda x: x if x.tz is not None else x.replace(tzinfo=pytz.utc) ) - source_df[created_timestamp_column] = source_df[created_timestamp_column].apply( - lambda x: x if x.tz is not None else x.replace(tzinfo=pytz.utc) - ) + if created_timestamp_column: + source_df[created_timestamp_column] = source_df[ + created_timestamp_column + ].apply(lambda x: x if x.tz is not None else x.replace(tzinfo=pytz.utc)) ts_columns = ( [event_timestamp_column, created_timestamp_column] - if created_timestamp_column is not None + if created_timestamp_column else [event_timestamp_column] ) diff --git a/sdk/python/feast/infra/provider.py b/sdk/python/feast/infra/provider.py index 2fb067a8b4..8d1d6639f7 100644 --- a/sdk/python/feast/infra/provider.py +++ b/sdk/python/feast/infra/provider.py @@ -264,7 +264,7 @@ def _coerce_datetime(ts): ) event_timestamp = _coerce_datetime(row[event_timestamp_idx]) - if feature_view.input.created_timestamp_column is not None: + if feature_view.input.created_timestamp_column: created_timestamp_idx = table.column_names.index( feature_view.input.created_timestamp_column )