Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 9 additions & 3 deletions sdk/python/feast/infra/offline_stores/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,13 @@ def pull_latest_from_table_or_query(
created_timestamp_column
].apply(lambda x: x if x.tzinfo is not None else x.replace(tzinfo=pytz.utc))

source_columns = set(source_df.columns)
if not set(join_key_columns).issubset(source_columns):
raise ValueError(
f"The DataFrame must have at least {set(join_key_columns)} columns present, "
f"but these were missing: {set(join_key_columns)- source_columns} "
)

ts_columns = (
[event_timestamp_column, created_timestamp_column]
if created_timestamp_column
Expand All @@ -229,8 +236,7 @@ def pull_latest_from_table_or_query(
# make driver_id a normal column again
last_values_df.reset_index(inplace=True)

table = pyarrow.Table.from_pandas(
last_values_df[join_key_columns + feature_name_columns + ts_columns]
)
columns_to_extract = set(join_key_columns + feature_name_columns + ts_columns)
table = pyarrow.Table.from_pandas(last_values_df[columns_to_extract])

return table
2 changes: 1 addition & 1 deletion sdk/python/feast/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def get_entity(self, name: str, project: str, allow_cache: bool = False) -> Enti
for entity_proto in registry_proto.entities:
if entity_proto.spec.name == name and entity_proto.spec.project == project:
return Entity.from_proto(entity_proto)
raise EntityNotFoundException(project, name)
raise EntityNotFoundException(name, project=project)

def apply_feature_table(self, feature_table: FeatureTable, project: str):
"""
Expand Down