fix: State.keys() now displays only keys without values (#409)#585
Merged
skrawcz merged 3 commits intoapache:mainfrom Oct 17, 2025
Merged
fix: State.keys() now displays only keys without values (#409)#585skrawcz merged 3 commits intoapache:mainfrom
skrawcz merged 3 commits intoapache:mainfrom
Conversation
zilto
reviewed
Oct 3, 2025
burr/core/state.py
Outdated
| Returns: | ||
| StateKeysView: A view object that shows only keys in its string representation | ||
| """ | ||
| return StateKeysView(self._state.keys()) |
Contributor
There was a problem hiding this comment.
I believe returning list(self._state) (implicitly self._state.keys()) would be sufficient.
Contributor
There was a problem hiding this comment.
yeah I'd vote for this simpler option if it works.
Contributor
Author
There was a problem hiding this comment.
Thanks for the feedback! The simpler approach is much better. Kindly check latest commit...
skrawcz
reviewed
Oct 4, 2025
Contributor
skrawcz
left a comment
There was a problem hiding this comment.
can you remove the redundancy in the tests please? e.g. just test for the exact return -- it covers all the cases.
Contributor
|
@elijahbenizzy any concerns on exposing |
Contributor
Author
|
Kindly check the latest commit and let me know any changes if required |
skrawcz
approved these changes
Oct 17, 2025
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.
Fix State.keys() displaying values (#409)
Problem:
State.keys()was showing both keys and values when printed, making it unusable with large objects (JSON responses, dataframes, embeddings).Solution: Added custom
StateKeyswrapper class that provides clean__repr__showing only keys, while maintaining fullKeysViewcompatibility (iteration, membership, length).Changes:
StateKeysclass with clean string representationState.keys()to returnStateKeyswrapperTesting:
Fixes #409