-
Notifications
You must be signed in to change notification settings - Fork 34
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
Add new bulk create constructor without optional _id field #245
Add new bulk create constructor without optional _id field #245
Conversation
68db8b7
to
1abe182
Compare
Signed-off-by: Cameron Durham <[email protected]>
1abe182
to
2dc360c
Compare
@Xtansia take a look? Regarding a breaking change: if it can be avoided it's best. Then we don't need to do a major release and break users. You can deprecate the old method. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #245 +/- ##
==========================================
+ Coverage 79.71% 79.85% +0.13%
==========================================
Files 418 417 -1
Lines 71104 69599 -1505
==========================================
- Hits 56682 55575 -1107
+ Misses 14422 14024 -398
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
It totally makes sense to avoid breaking change. And "making the Rust interface more consistent" doesn't seem to add enough value to warrant a version bump, imo. I'll revise to add new optional constructor from #241 in a non-breaking way. Testing And thanks for running test cases, I see I missed updating a bunch of tests will work on that. I had some trouble running these tests locally so didn't catch this before opening the CR.
|
I also don't feel this warrants a breaking version bump just for this, however there is an opportunity where you could PR a non-breaking change directly into |
Signed-off-by: Cameron Durham <[email protected]>
Signed-off-by: Cameron Durham <[email protected]>
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.
Changes look good, I just have some thoughts about the naming.
Could you please also add an entry to the CHANGELOG.md under the "Added" header.
You can ignore the Link Checker
workflow failure.
Co-authored-by: Thomas Farr <[email protected]> Signed-off-by: Cam <[email protected]>
Signed-off-by: camerondurham <[email protected]>
Thanks for the review @Xtansia, I accepted all suggestions and added an entry to the changelog. |
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-2.x 2.x
# Navigate to the new working tree
cd .worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-245-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 28e3d47a54c4fe1ce0a3647c872411602dc6b1e2
# Push it to GitHub
git push --set-upstream origin backport/backport-245-to-2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.x Then, create a pull request where the |
…h-project#245) * Use Option<S> when id is optional in bulk request Signed-off-by: Cameron Durham <[email protected]> * Revert "Use Option<S> when id is optional in bulk request" Signed-off-by: Cameron Durham <[email protected]> * Add no_id constructor and test case Signed-off-by: Cameron Durham <[email protected]> * Change constructor name from _no_id to _without_id Co-authored-by: Thomas Farr <[email protected]> Signed-off-by: Cam <[email protected]> * Add entry to CHANGELOG Signed-off-by: camerondurham <[email protected]> --------- Signed-off-by: Cameron Durham <[email protected]> Signed-off-by: Cam <[email protected]> Signed-off-by: camerondurham <[email protected]> Co-authored-by: Thomas Farr <[email protected]> (cherry picked from commit 28e3d47)
* Use Option<S> when id is optional in bulk request Signed-off-by: Cameron Durham <[email protected]> * Revert "Use Option<S> when id is optional in bulk request" Signed-off-by: Cameron Durham <[email protected]> * Add no_id constructor and test case Signed-off-by: Cameron Durham <[email protected]> * Change constructor name from _no_id to _without_id Co-authored-by: Thomas Farr <[email protected]> Signed-off-by: Cam <[email protected]> * Add entry to CHANGELOG Signed-off-by: camerondurham <[email protected]> --------- Signed-off-by: Cameron Durham <[email protected]> Signed-off-by: Cam <[email protected]> Signed-off-by: camerondurham <[email protected]> Co-authored-by: Thomas Farr <[email protected]> (cherry picked from commit 28e3d47) Co-authored-by: Cam <[email protected]>
Change (latest - revision 2)
Added new
create_no_id
andnew_no_id
constructors/helpers to support bulk create operations where no _id field is required.Change (revision 1)
Changed types to
id: Option<S>
when_id
is optional in the bulk request, otherwise, keepid
parameter asString
.This change is making the Bulk operation constructor parameters more closely match the Bulk API, specifically when
_id
is required or not.Summarized from the docs: https://www.elastic.co/guide/en/elasticsearch/reference/7.10/docs-bulk.html#bulk-api-request-body
create
:_id
(optional, string)delete
:_id
(required, string)index
:_id
(optional, string)update
_id
(required, string)Issues Resolved
Related to, and may close issue #241 .
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.