feat(dynamodb): Use ProjectionExpression when requested_features is set#6366
Merged
ntkathole merged 2 commits intoMay 14, 2026
Merged
Conversation
595a4bf to
a872a88
Compare
Contributor
Author
|
Friendly ping @franciscojavierarceo -- this has been open ~10 days. Let me know if anything needs adjusting. |
ntkathole
approved these changes
May 14, 2026
The requested_features parameter was accepted by online_read and online_read_async but never used -- DynamoDB always fetched all features stored in the values map regardless. Add a ProjectionExpression to BatchGetItem requests when requested_features is provided, reducing data transfer, latency, and read costs. Fixes feast-dev#6058 Signed-off-by: Jonathan Wrede <wrede.jonathan00@gmail.com>
The return dict contains both str and Dict[str, str] values, so the return type must be Dict[str, Any] not Dict[str, str]. Signed-off-by: Jonathan Wrede <wrede.jonathan00@gmail.com>
e9d7e8a to
2500dd3
Compare
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.
Summary
online_readandonline_read_asyncacceptrequested_featuresbut ignored it -- DynamoDB always fetched all features from thevaluesmapProjectionExpressiontoBatchGetItemrequests whenrequested_featuresis provided, so DynamoDB only returnsentity_id,event_ts, and the requested feature attributes withinvaluesExpressionAttributeNamesto avoid conflicts with DynamoDB reserved wordsFixes
Fixes #6058
Test plan
test_build_projection_expression-- verifies correct DynamoDB expression generationtest_build_projection_expression_none-- verifies None/empty returns Nonetest_dynamodb_online_store_online_read_with_requested_features-- verifies only requested features are returned (moto)test_dynamodb_online_store_online_read_without_requested_features-- verifies all features returned when not specified (moto)test_dynamodb_online_store_online_read_requested_features_parallel-- verifies filtering across parallel batches (moto)