Repository navigation
fix: Serialize UUID and TimeUuid entity keys - #7032
Open
MohammadHijjawi97 wants to merge 1 commit into
Open
MohammadHijjawi97 wants to merge 1 commit into
MohammadHijjawi97 wants to merge 1 commit into
Conversation
An entity whose join key is a Uuid or TimeUuid could be applied, but materializing it failed in serialize_entity_key with "Value type not supported for feast feature store", so its features never reached the online store and could not be served. Encode uuid_val and time_uuid_val as their UTF-8 string with the UUID and TIME_UUID value type tags, and decode them back in deserialize_entity_key. Signed-off-by: Mohammad Hijjawi <mohammad.hijjawi1997@gmail.com>
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7032 +/- ##
=======================================
Coverage 50.98% 50.99%
=======================================
Files 455 455
Lines 56964 56972 +8
Branches 8313 8317 +4
=======================================
+ Hits 29044 29053 +9
Misses 25935 25935
+ Partials 1985 1984 -1
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
An entity whose join key is a
UuidorTimeUuidcan be applied, but materializing its feature view fails, because_serialize_valinkey_encoding_utils.pyonly handles string, bytes, int32, int64 and unix timestamp values. The features never reach the online store, so they cannot be served. This affects every online store that builds its keys withserialize_entity_key(SQLite, Redis, DynamoDB, ...).Reproduction (local provider, FileSource, SQLite online store):
Before:
After:
(same result with a
TimeUuidentity)The fix encodes
uuid_valandtime_uuid_valas their UTF-8 string with theUUID/TIME_UUIDvalue type tags, the same way string keys are encoded, and_deserialize_valuedecodes them back sodeserialize_entity_keyround-trips. Existing key types are encoded exactly as before. This covers the Python serialization path.Which issue(s) this PR fixes:
No existing issue; found while using a UUID join key.
Checks
git commit -s)Testing Strategy
Added
test_serialize_deserialize_uuid_entity(Uuid and TimeUuid) tosdk/python/tests/unit/infra/test_key_encoding_utils.py; both cases fail without the change and pass with it (16/16 in that file).ruff check,ruff format --checkand mypy on the changed module pass.Misc