Added index support in data collector#675
Merged
Zayadul-huq-afnan merged 1 commit intodevfrom Mar 12, 2026
Merged
Conversation
Collaborator
Author
📚
|
Zayadul-huq-afnan
approved these changes
Mar 12, 2026
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.
PR Type
Feature
PR Checklist
Overview
This PR introduces support for post-indexing data collector results using square bracket notation (
[index]) immediately following the collector patterns (curly braces{}or parentheses()).Previously, data collectors returned their result set, which could be a list of values (for multiple patterns) or a single value. This change allows users to directly access a specific element from the collected result set using trailing indices, enabling the retrieval of a single value directly without intermediate variable assignment.
For pattern collection (
var{p1}{p2}), post-indexing likevar{p1}{p2}[0]now accesses the first element of the zipped result set. For key collection (var(k1)(k2)), post-indexing likevar(k1)(k2)[0]accesses the indexed element of the resulting structure. Error handling is added for invalid indices or types during post-indexing application.Test Cases