(
table: "FeatureView",
entity_name_to_join_key_map: Dict[str, str],
join_key_proto_values: Dict[str, List[ValueProto]],
)
| 933 | |
| 934 | |
| 935 | def _get_table_entity_values( |
| 936 | table: "FeatureView", |
| 937 | entity_name_to_join_key_map: Dict[str, str], |
| 938 | join_key_proto_values: Dict[str, List[ValueProto]], |
| 939 | ) -> Dict[str, List[ValueProto]]: |
| 940 | # The correct join_keys expected by the OnlineStore for this Feature View. |
| 941 | table_join_keys = [ |
| 942 | entity_name_to_join_key_map[entity_name] for entity_name in table.entities |
| 943 | ] |
| 944 | |
| 945 | # If the FeatureView has a Projection then the join keys may be aliased. |
| 946 | alias_to_join_key_map = {v: k for k, v in table.projection.join_key_map.items()} |
| 947 | |
| 948 | # Subset to columns which are relevant to this FeatureView and |
| 949 | # give them the correct names. |
| 950 | entity_values = { |
| 951 | alias_to_join_key_map.get(k, k): v |
| 952 | for k, v in join_key_proto_values.items() |
| 953 | if alias_to_join_key_map.get(k, k) in table_join_keys |
| 954 | } |
| 955 | return entity_values |
| 956 | |
| 957 | |
| 958 | def _get_unique_entities( |
no test coverage detected