Repository navigation
perf: Replace MessageToDict with optimized custom dict builder #6015
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
franciscojavierarceo
merged 12 commits into
feast-dev:master
from
abhijeet-dhumal:fix/custom-json-serialization-6013
May 28, 2026
Merged
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
b28ddf9
perf: Replace MessageToDict with optimized custom dict builder
abhijeet-dhumal 40846ad
Fix test: Use GetOnlineFeaturesResponseMetadata instead of non-existe…
abhijeet-dhumal ad4882b
fix: Rename to convert_response_to_dict, fix timestamp float-rounding…
abhijeet-dhumal 698d0a1
fix: Return raw bytes to match proto_json.patch() behavior
abhijeet-dhumal 0c0637b
fix: serialize top-level status field in convert_response_to_dict
abhijeet-dhumal 3ac1755
fix: replace deprecated ORJSONResponse with JSONResponse
abhijeet-dhumal 5fff274
fix: handle set, list, and map Value types in _value_to_native
abhijeet-dhumal b2f2909
fix: warn on scalar_map_val; fix test_unix_timestamp_list_val; docume…
abhijeet-dhumal c559ac5
docs: document float_precision=18 trade-off; add double_val round-tri…
abhijeet-dhumal 388f89b
fix: remove leftover orjson dead code causing mypy no-redef error
abhijeet-dhumal ecce3cf
fix: base64-encode bytes_val and bytes_list_val for JSON serialization
abhijeet-dhumal 25e99b1
style: remove extra blank line in feature_server_utils.py
abhijeet-dhumal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: handle set, list, and map Value types in _value_to_native
Previous implementation used "_list_" substring check which silently returned protobuf objects (not JSON-serializable) for: - *_set_val types (bytes_set_val, string_set_val, int64_set_val, etc.) - list_val / set_val (RepeatedValue with nested Values) - map_val / struct_val (Map<string, Value>) - map_list_val / struct_list_val (MapList) Add tests for all previously uncovered types and a float32 precision consistency test against MessageToDict. Signed-off-by: abhijeet-dhumal <abhijeetdhumal652@gmail.com>
- Loading branch information
commit 5fff274a0f9181e8d01c386da9c05e0f135d7414
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔴
bytes_valvalues cause ORJSONResponse to raise TypeError_value_to_nativeatfeature_server_utils.py:68returns rawbytesforbytes_valfields. Even iforjsonwere installed,orjson.dumps()cannot serialize Pythonbytesobjects and raisesTypeError: Type is not JSON serializable: bytes. The old code path returned the dict to FastAPI which processed it throughjsonable_encoder(capable of handling bytes). The switch toORJSONResponsebypasses that encoder, causing a regression for any response containing bytes-typed feature values.Prompt for agents
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abhijeet-dhumal bytes_val is still problem since you are using JSONResponse
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching this, Nikhil! Now bytes_val and bytes_list_val now base64-encode the output before returning, so JSONResponse / json.dumps can serialize them without TypeError.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please review!