-
Notifications
You must be signed in to change notification settings - Fork 127
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
Allow null value for params in method mappings #354
Conversation
Adds tests to reproduce Mapping Parsing Error when the parameters take the value null. Confirmed that both tests fail. Signed-off-by: John Mazanec <[email protected]>
Allow user to input null value for parameters field for KNNMethodContext and MethodComponentContext. Signed-off-by: John Mazanec <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #354 +/- ##
============================================
+ Coverage 83.99% 84.00% +0.01%
- Complexity 900 902 +2
============================================
Files 130 130
Lines 3854 3858 +4
Branches 353 355 +2
============================================
+ Hits 3237 3241 +4
Misses 457 457
Partials 160 160
Continue to review full report at Codecov.
|
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, thank you
Adding BWC test. Currently it fails for 1.1 to 1.2+. Will fix in subsequent commit. Signed-off-by: John Mazanec <[email protected]>
8ffcd3c
Adds support for parameters set to null so that index upgrades do not fail. Signed-off-by: John Mazanec <[email protected]>
Have you tried to run bwc on 1.2, I think that's the version where the issue can be reproduced with your new bwc test but without the code 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.
looks good, thank you
Released versions 1.2 and 1.3 do not support setting parameters to null so they will fail the test. Signed-off-by: John Mazanec <[email protected]>
Allow user to input null value for parameters field for KNNMethodContext and MethodComponentContext. Adds tests to reproduce Mapping Parsing Error when the parameters take the value null as well as BWC tests. Signed-off-by: John Mazanec <[email protected]> (cherry picked from commit b08127c)
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-1.2 1.2
# Navigate to the new working tree
cd .worktrees/backport-1.2
# Create a new branch
git switch --create backport/backport-354-to-1.2
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 b08127c2c4dcd1844072302e838f44897c8f18f5
# Push it to GitHub
git push --set-upstream origin backport/backport-354-to-1.2
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.2 Then, create a pull request where the |
Allow user to input null value for parameters field for KNNMethodContext and MethodComponentContext. Adds tests to reproduce Mapping Parsing Error when the parameters take the value null as well as BWC tests. Signed-off-by: John Mazanec <[email protected]> (cherry picked from commit b08127c)
Allow user to input null value for parameters field for KNNMethodContext and MethodComponentContext. Adds tests to reproduce Mapping Parsing Error when the parameters take the value null as well as BWC tests. Signed-off-by: John Mazanec <[email protected]> (cherry picked from commit b08127c)
Description
By default, in OpenSearch 1.0 and 1.1, if parameters were not set for method definitions, they were assigned a value of null. This causes an issue on upgrade to 1.2+, where null values for parameters are not accepted and throw a MappingParsingException.
The fix is to skip parsing the parameter value as a map in the input JSON if it is null.
Issues Resolved
#353
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.