Repository navigation
out_opensearch: strip spaces around commas in remove_keys_on_update - #206
Merged
Watson1978 merged 1 commit intoNov 17, 2026
Merged
Conversation
remove_keys_on_update was split on ',' alone, so "foo, bar" removed foo and looked for a key named " bar", and bar was still updated. remove_keys already splits on /\s*,\s*/; use the same separator. Signed-off-by: Lucas Barros <lucasbarros.kam@gmail.com>
Watson1978
approved these changes
Nov 17, 2026
Watson1978
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the fix. The new test fails on main, where baz stays in doc, and passes with this change. Values without spaces around commas split the same as before. Lists read from the record with remove_keys_on_update_key are not affected.
Looks good to me.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
remove_keysis split with/\s*,\s*/, and the README example for it has a space after the comma (remove_keys a_parent, a_routing).remove_keys_on_updateis split with','only. So the same style there:removes
foofrom the update document but looks for a key literally named" baz", andbazis still sent indocand overwritten on every update.remove_keys_on_updatenow uses the same/\s*,\s*/separator asremove_keys. Values without spaces (foo,bar, as in the README) split the same as before.remove_keys_on_update_keyreads the list from the record and is not affected.Test:
test_upsert_should_remove_keys_listed_with_spaces_after_commasintest/plugin/test_out_opensearch.rbchecks thatfoo, bazleaves{"id" => 1, "zip" => "zam"}indoc. It fails onmain, wherebazis still in the document, and passes with this change.test/plugin/test_out_opensearch.rb: 315 tests, 0 failures, 0 errors (TZ=UTC).(check all that apply)
versionin gemspec are untouched