From 40e16323289feca893c50e17014ffb13007e392b Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Thu, 8 Feb 2024 10:45:41 +0400 Subject: [PATCH] Stop mixing body and parameters in UpdateByQuery (#1702) --- elasticsearch_dsl/update_by_query.py | 2 +- tests/test_update_by_query.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/elasticsearch_dsl/update_by_query.py b/elasticsearch_dsl/update_by_query.py index 9b89f62b6..dd11856b1 100644 --- a/elasticsearch_dsl/update_by_query.py +++ b/elasticsearch_dsl/update_by_query.py @@ -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 diff --git a/tests/test_update_by_query.py b/tests/test_update_by_query.py index c10fde878..9ebc891e2 100644 --- a/tests/test_update_by_query.py +++ b/tests/test_update_by_query.py @@ -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():