Skip to content

Commit

Permalink
Stop mixing body and parameters in UpdateByQuery (#1702)
Browse files Browse the repository at this point in the history
  • Loading branch information
pquentin authored Feb 8, 2024
1 parent 6ab664d commit 40e1632
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion elasticsearch_dsl/update_by_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,6 @@ def execute(self):

self._response = self._response_class(
self,
es.update_by_query(index=self._index, body=self.to_dict(), **self._params),
es.update_by_query(index=self._index, **self.to_dict(), **self._params),
)
return self._response
4 changes: 1 addition & 3 deletions tests/test_update_by_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,7 @@ def test_params_being_passed_to_search(mock_client):
ubq = ubq.params(routing="42")
ubq.execute()

mock_client.update_by_query.assert_called_once_with(
index=None, body={}, routing="42"
)
mock_client.update_by_query.assert_called_once_with(index=None, routing="42")


def test_overwrite_script():
Expand Down

0 comments on commit 40e1632

Please sign in to comment.