Draft: Support full Python slice syntax in expand_node_string using real instance/device counts#77
Open
harsh-sikhwal wants to merge 14 commits into
Open
Draft: Support full Python slice syntax in expand_node_string using real instance/device counts#77harsh-sikhwal wants to merge 14 commits into
harsh-sikhwal wants to merge 14 commits into
Conversation
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
[start:stop]regex inexpand_node_string(infragraph_service.py) with a slice parser supporting full Python slice syntax:[:],[:-1],[1:],[::2], and bare/negative single indices._resolve_slice_indices()helper that resolves open-ended or negative slice bounds using real counts pulled from:_instance_data— for the leading instance name_device_data[...].components— for chained nested component/device namesstart:stopbehavior when counts aren't known yet; raisesInfrastructureErrorwhen a slice can't be resolved without a known count.test_expand_node_string.py, which was calling a nonexistent_expand_node_stringmethod (pre-existing bug — all 7 tests were erroring). Corrected toexpand_node_stringand added 2 new tests covering count-based slice resolution and the unresolvable-count error case.