-
Notifications
You must be signed in to change notification settings - Fork 47
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
All update modes to call to_s + coerce better. #77
All update modes to call to_s + coerce better. #77
Conversation
Align with upcoming PR logstash-plugins#75 Bump CHANGELOG to 3.2.3
671878d
to
f5422d9
Compare
end | ||
|
||
def test_for_inclusion(event, override) | ||
# Skip translation in case @destination iterate_on already exists and @override is disabled. | ||
return false if event.include?(@destination) && !override | ||
return false if !override && event.include?(@destination) |
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.
why this change?
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.
Its better to check the boolean before making the more expensive include?
call, no?
@@ -25,7 +25,7 @@ def update(event) | |||
inner = event.get(nested_field) | |||
next if inner.nil? | |||
matched = [true, nil] | |||
@lookup.fetch_strategy.fetch(inner, matched) | |||
@lookup.fetch_strategy.fetch(inner.to_s, matched) |
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.
these changes should be accompanied by a couple of tests, maybe? like showing how integer keys get coerced in to strings and an array gets coerced into its first element
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.
Sure, will do.
CHANGELOG.md
Outdated
@@ -1,4 +1,5 @@ | |||
## master | |||
## 3.2.3 | |||
- Fix to align with docs - looked-up values are always strings. Coerce better. |
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 link to pr 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.
LGTM, with a minor note to include pr link in changelog
Align with upcoming PR #75
Thanks for contributing to Logstash! If you haven't already signed our CLA, here's a handy link: https://www.elastic.co/contributor-agreement/