-
Notifications
You must be signed in to change notification settings - Fork 37
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
Fix json collector decorator and switch json parsing library to orjson #553
Conversation
Bumps [boto3](https://github.com/boto/boto3) from 1.33.7 to 1.33.9. - [Release notes](https://github.com/boto/boto3/releases) - [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst) - [Commits](boto/boto3@1.33.7...1.33.9) --- updated-dependencies: - dependency-name: boto3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
448411d
to
80e19be
Compare
Minimum allowed coverage is Generated by 🐒 cobertura-action against 1dc42f3 |
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.
Thanks for this. I wonder if we should also make the PR title more descriptive. Pre-release sounds a bit generic.
handlers/aws/utils.py
Outdated
@@ -313,8 +313,11 @@ def get_trigger_type_and_config_source(event: dict[str, Any]) -> tuple[str, str] | |||
and "eventSource" in body["Records"][0] | |||
): | |||
event_source = body["Records"][0]["eventSource"] | |||
if event_source not in _available_triggers: | |||
raise Exception |
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 would add an exception message of some kind here
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 added a message only where the exceptions will bubble up to the function callar
single: list[tuple[Union[StorageReader, bytes], int, int, bytes]] = list( | ||
[ | ||
(data, starting_offset, ending_offset, newline) | ||
for data, starting_offset, ending_offset, newline, _ in iterator | ||
] | ||
) |
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 find this DS a bit hard to digest. Maybe a comment with an example entry could help
storage/decorator.py
Outdated
# if it's not a json object we can just forward the content by lines | ||
if not json_collector_state.has_an_object_start: |
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.
This comment does not seem to be consistent with the if statement below. Should this use json_collector_state.is_a_json_object
instead?
@girodav addressed your comment, please review :) |
@girodav , I fixed a couple of comments and review status was dismissed feel free to re-approve and merge, thanks :) |
Bug/Enhancement
What does this PR do?
Fix a bug related to event list from field expander where, if json content type was single and spanning more than 1000 lines the circuit breaker of the json decorator will kick in
It also switch orjson parsing library over ujson one
Why is it important?
A regression was introduced on json decorator while refactored with #544
Also switching from usjon to orjson improves performances
Checklist
- [ ] I have made corresponding changes to the documentation- [ ] I have made corresponding change to the default configuration filesCHANGELOG.md
Author's Checklist
How to test this PR locally
Related issues
Use cases
Screenshots
Logs