-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Add Starlark parsing example of nested JSON #8675
Conversation
in the input collecting the JSON data. The entire JSON obj/doc will | ||
be set to a Field named `value` with which this code will work. | ||
|
||
Example input: ``` |
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.
Has to be
Example input: ``` | |
Example Input: ``` |
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.
Furthermore I'm not sure if the current implementation of the test can cope with multi-line input. AFAIK we read one input per line, so please remove the nice formatting and make it an ugly one-liner. Never thought I will say this ever... ;-)
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.
Last but not least the given input/output has to be in line-protocol format... Please fix those issues to keep the starlark test-suite working...
}, | ||
"timestamp": 1591124461 | ||
} ``` | ||
Example output: |
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.
Has to be Example Output
.
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.
The starlark testdata directory contains testable examples. To run those tests the Example Input
and Example Output
have to be in influx-line-protocol format. Please fix those. Code looks good.
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.
Thank you very much!
@srebhan this commit shouldn't have been part of the PR. I still need to make the changes you mentioned to this one. I crossed PRs accidentally. |
@samhld you can still change the PR and force-push it to replace it completely. I will remove the "ready-to-merge" flag for the time being. Please tell me once you are ready... |
1273849
to
eeb5082
Compare
ok @srebhan this one should be good to go too! |
|
||
|
||
load("json.star", "json") | ||
load("logging.star", "log") |
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.
I guess this is not required anymore!?
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.
Please remove the import of logging.star
. Otherwise it's good to go.
@samhld any news on this? |
@srebhan Missed this, sorry! Done. |
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.
Looks good.
* Add Starlark parsing example of nested JSON * add correct Example Input and Output fields to make script testable * removed logging from script * remove logging.star load statement (cherry picked from commit 380911f)
* Add Starlark parsing example of nested JSON * add correct Example Input and Output fields to make script testable * removed logging from script * remove logging.star load statement (cherry picked from commit 380911f)
Required for all PRs: