MCPcopy Index your code
hub / github.com/feast-dev/feast / _build_entity_keys

Function _build_entity_keys

sdk/python/feast/utils.py:384–407  ·  view source on GitHub ↗

Build entity key protos for each row. Args: num_rows: Number of rows to generate entity keys for. join_keys: Dict mapping join key names to their value types. proto_values: Dict mapping column names to lists of ValueProto values. Returns: List of EntityKeyPr

(
    num_rows: int,
    join_keys: Dict[str, ValueType],
    proto_values: Dict[str, List[ValueProto]],
)

Source from the content-addressed store, hash-verified

382
383
384def _build_entity_keys(
385 num_rows: int,
386 join_keys: Dict[str, ValueType],
387 proto_values: Dict[str, List[ValueProto]],
388) -> List[EntityKeyProto]:
389 """Build entity key protos for each row.
390
391 Args:
392 num_rows: Number of rows to generate entity keys for.
393 join_keys: Dict mapping join key names to their value types.
394 proto_values: Dict mapping column names to lists of ValueProto values.
395
396 Returns:
397 List of EntityKeyProto, one per row.
398 """
399 return [
400 EntityKeyProto(
401 join_keys=list(join_keys.keys()),
402 entity_values=[
403 proto_values[k][idx] for k in join_keys if k in proto_values
404 ],
405 )
406 for idx in range(num_rows)
407 ]
408
409
410def _convert_arrow_to_proto(

Callers 2

Calls 1

keysMethod · 0.80

Tested by

no test coverage detected