entity_key_serialization_version: version of the entity key serialization
Versions:
version 3: entity_key size is added to the serialization for deserialization purposes
entity_key: EntityKeyProto
Returns: bytes of the serialized entity key
"""
ifentity_key_serialization_version<3:
# Not raising the error, keeping it in warning state for reserialization purpose
# We should remove this after few releases
warnings.warn(
"Serialization of entity key with version < 3 is removed. Please use version 3 by setting entity_key_serialization_version=3."
"To reserializa your online store featrues refer - https://github.com/feast-dev/feast/blob/master/docs/how-to-guides/entity-reserialization-of-from-v2-to-v3.md"
# Not raising the error, keeping it in warning state for reserialization purpose
# We should remove this after few releases
warnings.warn(
"Deserialization of entity key with version < 3 is removed. Please use version 3 by setting entity_key_serialization_version=3."
"To reserializa your online store featrues refer - https://github.com/feast-dev/feast/blob/master/docs/how-to-guides/entity-reserialization-of-from-v2-to-v3.md"
)
# Optimized deserialization using memoryview for zero-copy slicing
buffer=memoryview(serialized_entity_key)
pos=0
keys= []
values= []
# Read number of keys
iflen(buffer) <pos+4:
raiseValueError(
"Invalid serialized entity key: insufficient data for key count"