-
Notifications
You must be signed in to change notification settings - Fork 3.1k
[pkg/ottl] Add ParseSeverity function
#37280
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
base: main
Are you sure you want to change the base?
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]>
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]>
… made to mapGetter 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]>
|
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
|
@bacherfl is this still draft? |
|
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
Signed-off-by: Florian Bacher <[email protected]>
|
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
|
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
|
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
|
@edmocosta I have now updated the PR to convert the mapping literal at the time of the function's initialisation, rather than parsing it at each invocation of the function. |
Description
This PR adds the
ParseSeverityfunction, as discussed in the linked ticket. I also had to make a minor change to theinternal
mapGetter, handling the map literals to return a rawmap[string]any, instead of apcommon.Map. This is because if there is a map literal within a slice, thepcommon.Slice.FromRawcannot handle thepcommon.Map, as it only works with raw data types.This change is however transparent, and the behavior to the outside of this package does not change.
EDIT: After merging main with the support for value expressions, introduced in #36883, this would affect the type of values returned by
ParseValueExpression- previously this could potentially returnmap[string]any/[]any, but with the changes introduced in this PR, this would return apcommon.Map/pcommon.Slice.Please let me know if I should do this change in a separate PR though.
Link to tracking issue
Fixes #35079
Testing
Added unit and e2e tests
Documentation
Describe new function in the readme