-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[pkg/ottl] add support for map literals #34168
[pkg/ottl] add support for map literals #34168
Conversation
Signed-off-by: Florian Bacher <[email protected]>
Signed-off-by: Florian Bacher <[email protected]>
Signed-off-by: Florian Bacher <[email protected]>
Signed-off-by: Florian Bacher <[email protected]>
Signed-off-by: Florian Bacher <[email protected]>
@evan-bradley this one should be ready for review now |
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.
Really excited to see this one, thanks for taking this on.
Signed-off-by: Florian Bacher <[email protected]>
Signed-off-by: Florian Bacher <[email protected]>
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.
Overall looks good to me outside a request regarding the map type.
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.
Another question I'd like discussed in the issue: should map literals be indexable in the grammar? I would think not, since we don't allow that for slice literals either.
Signed-off-by: Florian Bacher <[email protected]>
Signed-off-by: Florian Bacher <[email protected]>
…erfl/opentelemetry-collector-contrib into feat/32388/add-map-literals
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
@TylerHelmuth I think this one is still ready whenever you have time. |
pkg/ottl/lexer_test.go
Outdated
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.
We've added new tokens so we need to add tests that recognize them.
@@ -89,6 +89,115 @@ func Test_parse(t *testing.T) { | |||
WhereClause: nil, | |||
}, | |||
}, | |||
{ | |||
name: "editor with map", |
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.
Can you add a test for an empty map
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.
Also an editor with a converter with a map.
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.
Normally new getters means new tests in functions_test.go
. Do we need one here as well?
Signed-off-by: Florian Bacher <[email protected]>
Looking at those tests it seems they are only testing the functionality of the exported getters (e.g. |
Thank you for the review @TylerHelmuth - I added additional test cases where applicable |
**Description:** This PR extends the OTTL grammar to support map literals **Link to tracking Issue:** open-telemetry#32388 **Testing:** Unit tests; E2E Tests **Documentation:** Extended the docs with a section about the added data type --------- Signed-off-by: Florian Bacher <[email protected]>
Description: This PR extends the OTTL grammar to support map literals
Link to tracking Issue: #32388
Testing: Unit tests; E2E Tests
Documentation: Extended the docs with a section about the added data type