Skip to content
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(match_datadog_query): do not panic when attempting to parse invalid paths #1031

Merged
merged 8 commits into from
Sep 10, 2024

Conversation

pront
Copy link
Member

@pront pront commented Sep 9, 2024

@pront pront changed the title WIP fix(match_datadog_query): do not panic when attempting to parse invalid paths Sep 9, 2024
@pront pront marked this pull request as ready for review September 9, 2024 19:57
Copy link
Member

@jszwedko jszwedko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an improvement so I'm ok with seeing it merged, but should it be bubbling up the errors instead of silently ignoring the invalid fields?

Comment on lines 123 to 125
let Ok(buf) = lookup_field(&field) else {
return Run::boxed(|_| false);
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL this syntax works for assignments outside of conditions.

@pront
Copy link
Member Author

pront commented Sep 9, 2024

This is an improvement so I'm ok with seeing it merged, but should it be bubbling up the errors instead of silently ignoring the invalid fields?

Oh yes, good point. I added an error! for now. Propagating the error further will need some refactoring, I might follow-up in another PR.

@pront pront enabled auto-merge September 9, 2024 20:16
src/stdlib/match_datadog_query.rs Outdated Show resolved Hide resolved
@pront pront disabled auto-merge September 9, 2024 20:20
@pront pront requested review from jszwedko and bruceg September 9, 2024 21:01
Copy link
Member

@jszwedko jszwedko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! This is looking even better to me now. Just left a couple of comments inline.

src/stdlib/match_datadog_query.rs Outdated Show resolved Hide resolved
src/stdlib/match_datadog_query.rs Outdated Show resolved Hide resolved
@pront pront enabled auto-merge September 10, 2024 13:56
@pront pront added this pull request to the merge queue Sep 10, 2024
Merged via the queue into main with commit 7e9f7fa Sep 10, 2024
14 checks passed
@pront pront deleted the pront/i998 branch September 10, 2024 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panic when match_datadog_query references key with hyphen
3 participants