Skip to content
Open
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
18 changes: 11 additions & 7 deletions sdk/python/feast/infra/online_stores/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,17 +598,21 @@ def _construct_online_read_api_json_request(
for requested_feature in requested_features:
api_requested_features.append(f"{table.name}:{requested_feature}")

entity_values = []
entity_key = ""
entity_columns: Dict[str, List[Any]] = {}
for row in entity_keys:
entity_key = row.join_keys[0]
entity_values.append(
getattr(row.entity_values[0], row.entity_values[0].WhichOneof("val")) # type: ignore[arg-type]
)
if len(row.join_keys) != len(row.entity_values):
raise ValueError(
f"Entity key has {len(row.join_keys)} join keys but "
f"{len(row.entity_values)} values; these must be the same length."
)
for join_key, value in zip(row.join_keys, row.entity_values):
entity_columns.setdefault(join_key, []).append(
getattr(value, value.WhichOneof("val")) # type: ignore[arg-type]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WhichOneof("val") returns None for an unset ValueProto, so getattr(value, None) raises TypeError here. The issue specifically calls out null entity values; this should append None instead.

)

return {
"features": api_requested_features,
"entities": {entity_key: entity_values},
"entities": entity_columns,
}

def _construct_online_documents_api_json_request(
Expand Down
Loading