Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-elasticsearch-dsl for 
openSUSE:Factory checked in at 2023-05-10 16:19:55
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-elasticsearch-dsl (Old)
 and      /work/SRC/openSUSE:Factory/.python-elasticsearch-dsl.new.1533 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-elasticsearch-dsl"

Wed May 10 16:19:55 2023 rev:6 rq:1086025 version:7.4.1

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-elasticsearch-dsl/python-elasticsearch-dsl.changes
        2022-11-29 10:54:16.761090833 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-elasticsearch-dsl.new.1533/python-elasticsearch-dsl.changes
      2023-05-10 16:19:58.243488012 +0200
@@ -1,0 +2,8 @@
+Wed May 10 08:40:05 UTC 2023 - Daniel Garcia <daniel.gar...@suse.com>
+
+- Delete drop-python2-support.patch
+- Update to 7.4.1:
+  * Fixed DeprecationWarnings that would be emitted from deprecated
+    usages of the body parameter in the Python Elasticsearch client.
+
+-------------------------------------------------------------------

Old:
----
  drop-python2-support.patch
  elasticsearch-dsl-7.4.0.tar.gz

New:
----
  elasticsearch-dsl-7.4.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-elasticsearch-dsl.spec ++++++
--- /var/tmp/diff_new_pack.zNxyvC/_old  2023-05-10 16:19:59.083492981 +0200
+++ /var/tmp/diff_new_pack.zNxyvC/_new  2023-05-10 16:19:59.091493029 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package python-elasticsearch-dsl
 #
-# Copyright (c) 2022 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
 
 
 Name:           python-elasticsearch-dsl
-Version:        7.4.0
+Version:        7.4.1
 Release:        0
 Summary:        Python client for Elasticsearch
 License:        Apache-2.0
@@ -28,8 +28,6 @@
 # PATCH-FEATURE-UPSTREAM python-elasticsearch-dsl-no-mock.patch 
gh#elastic/elasticsearch-dsl-py#1596 mc...@suse.com
 # Use unittest.mock instead of the external package (merged to master, not yet 
released)
 Patch0:         python-elasticsearch-dsl-no-mock.patch
-# PATCH-FEATURE-UPSTREAM drop-python2-support.patch 
gh#elastic/elasticsearch-dsl-py@f7f85a5db8f2
-Patch1:         drop-python2-support.patch
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros

++++++ elasticsearch-dsl-7.4.0.tar.gz -> elasticsearch-dsl-7.4.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/elasticsearch-dsl-py-7.4.0/.github/workflows/ci.yml 
new/elasticsearch-dsl-py-7.4.1/.github/workflows/ci.yml
--- old/elasticsearch-dsl-py-7.4.0/.github/workflows/ci.yml     2021-07-15 
17:31:30.000000000 +0200
+++ new/elasticsearch-dsl-py-7.4.1/.github/workflows/ci.yml     2023-03-01 
21:46:54.000000000 +0100
@@ -43,9 +43,9 @@
     runs-on: ubuntu-latest
     steps:
       - name: Checkout Repository
-        uses: actions/checkout@v1
+        uses: actions/checkout@v2
       - name: Set up Python 3.8
-        uses: actions/setup-python@v1
+        uses: actions/setup-python@v2
         with:
           python-version: 3.8
       - name: Install dependencies
@@ -65,24 +65,24 @@
 
     steps:
       - name: Checkout Repository
-        uses: actions/checkout@v1
+        uses: actions/checkout@v2
       - name: Setup Elasticsearch
         run: |
           mkdir /tmp/elasticsearch
           wget -O - 
https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${{ 
matrix.es-version }}-linux-x86_64.tar.gz | tar xz 
--directory=/tmp/elasticsearch --strip-components=1
           /tmp/elasticsearch/bin/elasticsearch -d
       - name: Setup Python - ${{ matrix.python-version }}
-        uses: actions/setup-python@v1
+        uses: actions/setup-python@v2
         with:
           python-version: ${{ matrix.python-version }}
       - name: Set up Python 3.8 for Nox
         if: matrix.python-version != '3.8'
-        uses: actions/setup-python@v1
+        uses: actions/setup-python@v2
         with:
-          python-version: 3.8
+          python-version: 3
       - name: Install dependencies
         run: |
-          python3.8 -m pip install nox
+          python3 -m pip install nox
       - name: Run Tests
         run: |
           nox -rs test-${{ matrix.python-version }}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/elasticsearch-dsl-py-7.4.0/Changelog.rst 
new/elasticsearch-dsl-py-7.4.1/Changelog.rst
--- old/elasticsearch-dsl-py-7.4.0/Changelog.rst        2021-07-15 
17:31:30.000000000 +0200
+++ new/elasticsearch-dsl-py-7.4.1/Changelog.rst        2023-03-01 
21:46:54.000000000 +0100
@@ -3,6 +3,13 @@
 Changelog
 =========
 
+7.4.1 (2023-03-01)
+------------------
+
+* Fixed ``DeprecationWarnings`` that would be emitted from deprecated
+  usages of the ``body`` parameter in the Python Elasticsearch client.
+
+
 7.4.0 (2021-07-15)
 ------------------
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/elasticsearch-dsl-py-7.4.0/docs/search_dsl.rst 
new/elasticsearch-dsl-py-7.4.1/docs/search_dsl.rst
--- old/elasticsearch-dsl-py-7.4.0/docs/search_dsl.rst  2021-07-15 
17:31:30.000000000 +0200
+++ new/elasticsearch-dsl-py-7.4.1/docs/search_dsl.rst  2023-03-01 
21:46:54.000000000 +0100
@@ -532,6 +532,9 @@
     for h in response:
         print(h.title, h.body)
 
+.. note::
+
+  If you are only seeing partial results (e.g. 10000 or even 10 results), 
consider using the option ``s.extra(track_total_hits=True)`` to get a full hit 
count.
 
 Result
 ~~~~~~
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/elasticsearch-dsl-py-7.4.0/elasticsearch_dsl/__init__.py 
new/elasticsearch-dsl-py-7.4.1/elasticsearch_dsl/__init__.py
--- old/elasticsearch-dsl-py-7.4.0/elasticsearch_dsl/__init__.py        
2021-07-15 17:31:30.000000000 +0200
+++ new/elasticsearch-dsl-py-7.4.1/elasticsearch_dsl/__init__.py        
2023-03-01 21:46:54.000000000 +0100
@@ -84,7 +84,7 @@
 from .utils import AttrDict, AttrList, DslBase
 from .wrappers import Range
 
-VERSION = (7, 4, 0)
+VERSION = (7, 4, 1)
 __version__ = VERSION
 __versionstr__ = ".".join(map(str, VERSION))
 __all__ = [
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/elasticsearch-dsl-py-7.4.0/elasticsearch_dsl/connections.py 
new/elasticsearch-dsl-py-7.4.1/elasticsearch_dsl/connections.py
--- old/elasticsearch-dsl-py-7.4.0/elasticsearch_dsl/connections.py     
2021-07-15 17:31:30.000000000 +0200
+++ new/elasticsearch-dsl-py-7.4.1/elasticsearch_dsl/connections.py     
2023-03-01 21:46:54.000000000 +0100
@@ -15,11 +15,16 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-from elasticsearch import Elasticsearch
+from elasticsearch import Elasticsearch, __version__
 from six import string_types
 
 from .serializer import serializer
 
+# The 'body' parameter was deprecated in favor of named
+# body parameters in version 7.15.0 of the client. The relevant APIs
+# affected include 'search', 'index', 'update', and 'indices.create'
+CLIENT_HAS_NAMED_BODY_PARAMS = __version__ >= (7, 15, 0)
+
 
 class Connections(object):
     """
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/elasticsearch-dsl-py-7.4.0/elasticsearch_dsl/document.py 
new/elasticsearch-dsl-py-7.4.1/elasticsearch_dsl/document.py
--- old/elasticsearch-dsl-py-7.4.0/elasticsearch_dsl/document.py        
2021-07-15 17:31:30.000000000 +0200
+++ new/elasticsearch-dsl-py-7.4.1/elasticsearch_dsl/document.py        
2023-03-01 21:46:54.000000000 +0100
@@ -25,7 +25,7 @@
 from elasticsearch.exceptions import NotFoundError, RequestError
 from six import add_metaclass, iteritems
 
-from .connections import get_connection
+from .connections import CLIENT_HAS_NAMED_BODY_PARAMS, get_connection
 from .exceptions import IllegalOperation, ValidationException
 from .field import Field
 from .index import Index
@@ -416,10 +416,10 @@
             body["doc"] = {k: values.get(k) for k in fields.keys()}
 
         # extract routing etc from meta
-        doc_meta = {k: self.meta[k] for k in DOC_META_FIELDS if k in self.meta}
+        params = {k: self.meta[k] for k in DOC_META_FIELDS if k in self.meta}
 
         if retry_on_conflict is not None:
-            doc_meta["retry_on_conflict"] = retry_on_conflict
+            params["retry_on_conflict"] = retry_on_conflict
 
         # Optimistic concurrency control
         if (
@@ -427,11 +427,18 @@
             and "seq_no" in self.meta
             and "primary_term" in self.meta
         ):
-            doc_meta["if_seq_no"] = self.meta["seq_no"]
-            doc_meta["if_primary_term"] = self.meta["primary_term"]
+            params["if_seq_no"] = self.meta["seq_no"]
+            params["if_primary_term"] = self.meta["primary_term"]
+
+        params["refresh"] = refresh
+
+        if CLIENT_HAS_NAMED_BODY_PARAMS:
+            params.update(body)
+        else:
+            params["body"] = body
 
         meta = self._get_connection(using).update(
-            index=self._get_index(index), body=body, refresh=refresh, 
**doc_meta
+            index=self._get_index(index), **params
         )
         # update meta information from ES
         for k in META_FIELDS:
@@ -474,19 +481,20 @@
 
         es = self._get_connection(using)
         # extract routing etc from meta
-        doc_meta = {k: self.meta[k] for k in DOC_META_FIELDS if k in self.meta}
+        params = {k: self.meta[k] for k in DOC_META_FIELDS if k in self.meta}
 
         # Optimistic concurrency control
         if "seq_no" in self.meta and "primary_term" in self.meta:
-            doc_meta["if_seq_no"] = self.meta["seq_no"]
-            doc_meta["if_primary_term"] = self.meta["primary_term"]
+            params["if_seq_no"] = self.meta["seq_no"]
+            params["if_primary_term"] = self.meta["primary_term"]
 
-        doc_meta.update(kwargs)
-        meta = es.index(
-            index=self._get_index(index),
-            body=self.to_dict(skip_empty=skip_empty),
-            **doc_meta
-        )
+        if CLIENT_HAS_NAMED_BODY_PARAMS:
+            params["document"] = self.to_dict(skip_empty=skip_empty)
+        else:
+            params["body"] = self.to_dict(skip_empty=skip_empty)
+
+        params.update(kwargs)
+        meta = es.index(index=self._get_index(index), **params)
         # update meta information from ES
         for k in META_FIELDS:
             if "_" + k in meta:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/elasticsearch-dsl-py-7.4.0/elasticsearch_dsl/faceted_search.py 
new/elasticsearch-dsl-py-7.4.1/elasticsearch_dsl/faceted_search.py
--- old/elasticsearch-dsl-py-7.4.0/elasticsearch_dsl/faceted_search.py  
2021-07-15 17:31:30.000000000 +0200
+++ new/elasticsearch-dsl-py-7.4.1/elasticsearch_dsl/faceted_search.py  
2023-03-01 21:46:54.000000000 +0100
@@ -117,7 +117,7 @@
     agg_type = "terms"
 
     def add_filter(self, filter_values):
-        """ Create a terms filter instead of bool containing term filters.  """
+        """Create a terms filter instead of bool containing term filters."""
         if filter_values:
             return Terms(
                 _expand__to_dot=False, **{self._params["field"]: filter_values}
@@ -169,7 +169,9 @@
 
 
 def _date_interval_year(d):
-    return d.replace(year=d.year+1, day=(28 if d.month == 2 and d.day == 29 
else d.day))
+    return d.replace(
+        year=d.year + 1, day=(28 if d.month == 2 and d.day == 29 else d.day)
+    )
 
 
 def _date_interval_month(d):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/elasticsearch-dsl-py-7.4.0/elasticsearch_dsl/index.py 
new/elasticsearch-dsl-py-7.4.1/elasticsearch_dsl/index.py
--- old/elasticsearch-dsl-py-7.4.0/elasticsearch_dsl/index.py   2021-07-15 
17:31:30.000000000 +0200
+++ new/elasticsearch-dsl-py-7.4.1/elasticsearch_dsl/index.py   2023-03-01 
21:46:54.000000000 +0100
@@ -16,7 +16,7 @@
 #  under the License.
 
 from . import analysis
-from .connections import get_connection
+from .connections import CLIENT_HAS_NAMED_BODY_PARAMS, get_connection
 from .exceptions import IllegalOperation
 from .mapping import Mapping
 from .search import Search
@@ -276,9 +276,15 @@
         Any additional keyword arguments will be passed to
         ``Elasticsearch.indices.create`` unchanged.
         """
-        return self._get_connection(using).indices.create(
-            index=self._name, body=self.to_dict(), **kwargs
-        )
+        es = self._get_connection(using)
+
+        if CLIENT_HAS_NAMED_BODY_PARAMS:
+            params = self.to_dict()
+        else:
+            params = {"body": self.to_dict()}
+        params.update(kwargs)
+
+        return es.indices.create(index=self._name, **params)
 
     def is_closed(self, using=None):
         state = self._get_connection(using).cluster.state(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/elasticsearch-dsl-py-7.4.0/elasticsearch_dsl/mapping.py 
new/elasticsearch-dsl-py-7.4.1/elasticsearch_dsl/mapping.py
--- old/elasticsearch-dsl-py-7.4.0/elasticsearch_dsl/mapping.py 2021-07-15 
17:31:30.000000000 +0200
+++ new/elasticsearch-dsl-py-7.4.1/elasticsearch_dsl/mapping.py 2023-03-01 
21:46:54.000000000 +0100
@@ -65,7 +65,7 @@
         return self
 
     def _collect_fields(self):
-        """ Iterate over all Field objects within, including multi fields. """
+        """Iterate over all Field objects within, including multi fields."""
         for f in itervalues(self.properties.to_dict()):
             yield f
             # multi fields
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/elasticsearch-dsl-py-7.4.0/elasticsearch_dsl/search.py 
new/elasticsearch-dsl-py-7.4.1/elasticsearch_dsl/search.py
--- old/elasticsearch-dsl-py-7.4.0/elasticsearch_dsl/search.py  2021-07-15 
17:31:30.000000000 +0200
+++ new/elasticsearch-dsl-py-7.4.1/elasticsearch_dsl/search.py  2023-03-01 
21:46:54.000000000 +0100
@@ -27,7 +27,7 @@
 from six import iteritems, string_types
 
 from .aggs import A, AggBase
-from .connections import get_connection
+from .connections import CLIENT_HAS_NAMED_BODY_PARAMS, get_connection
 from .exceptions import IllegalOperation
 from .query import Bool, Q
 from .response import Hit, Response
@@ -711,8 +711,16 @@
         if ignore_cache or not hasattr(self, "_response"):
             es = get_connection(self._using)
 
+            if CLIENT_HAS_NAMED_BODY_PARAMS:
+                params = self.to_dict()
+                if "from" in params:
+                    params["from_"] = params.pop("from")
+            else:
+                params = {"body": self.to_dict()}
+            params.update(self._params)
+
             self._response = self._response_class(
-                self, es.search(index=self._index, body=self.to_dict(), 
**self._params)
+                self, es.search(index=self._index, **params)
             )
         return self._response
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/elasticsearch-dsl-py-7.4.0/elasticsearch_dsl/utils.py 
new/elasticsearch-dsl-py-7.4.1/elasticsearch_dsl/utils.py
--- old/elasticsearch-dsl-py-7.4.0/elasticsearch_dsl/utils.py   2021-07-15 
17:31:30.000000000 +0200
+++ new/elasticsearch-dsl-py-7.4.1/elasticsearch_dsl/utils.py   2023-03-01 
21:46:54.000000000 +0100
@@ -273,7 +273,7 @@
             self._setattr(pname, pvalue)
 
     def _repr_params(self):
-        """ Produce a repr of all our parameters to be used in __repr__. """
+        """Produce a repr of all our parameters to be used in __repr__."""
         return ", ".join(
             "{}={!r}".format(n.replace(".", "__"), v)
             for (n, v) in sorted(iteritems(self._params))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/elasticsearch-dsl-py-7.4.0/examples/parent_child.py 
new/elasticsearch-dsl-py-7.4.1/examples/parent_child.py
--- old/elasticsearch-dsl-py-7.4.0/examples/parent_child.py     2021-07-15 
17:31:30.000000000 +0200
+++ new/elasticsearch-dsl-py-7.4.1/examples/parent_child.py     2023-03-01 
21:46:54.000000000 +0100
@@ -123,7 +123,7 @@
 
     @classmethod
     def _matches(cls, hit):
-        """ Use Question class for parent documents """
+        """Use Question class for parent documents"""
         return hit["_source"]["question_answer"] == "question"
 
     @classmethod
@@ -176,7 +176,7 @@
 
     @classmethod
     def _matches(cls, hit):
-        """ Use Answer class for child documents with child name 'answer' """
+        """Use Answer class for child documents with child name 'answer'"""
         return (
             isinstance(hit["_source"]["question_answer"], dict)
             and hit["_source"]["question_answer"].get("name") == "answer"
@@ -203,7 +203,7 @@
 
 
 def setup():
-    """ Create an IndexTemplate and save it into elasticsearch. """
+    """Create an IndexTemplate and save it into elasticsearch."""
     index_template = Post._index.as_template("base")
     index_template.save()
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/elasticsearch-dsl-py-7.4.0/noxfile.py 
new/elasticsearch-dsl-py-7.4.1/noxfile.py
--- old/elasticsearch-dsl-py-7.4.0/noxfile.py   2021-07-15 17:31:30.000000000 
+0200
+++ new/elasticsearch-dsl-py-7.4.1/noxfile.py   2023-03-01 21:46:54.000000000 
+0100
@@ -46,7 +46,7 @@
 
 @nox.session()
 def format(session):
-    session.install("black", "isort")
+    session.install("black==21.12b0", "click==8.0.4", "isort")
     session.run(
         "black", "--target-version=py27", "--target-version=py37", 
*SOURCE_FILES
     )
@@ -58,7 +58,7 @@
 
 @nox.session
 def lint(session):
-    session.install("flake8", "black", "isort")
+    session.install("flake8", "black==21.12b0", "click==8.0.4", "isort")
     session.run(
         "black",
         "--check",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/elasticsearch-dsl-py-7.4.0/setup.py 
new/elasticsearch-dsl-py-7.4.1/setup.py
--- old/elasticsearch-dsl-py-7.4.0/setup.py     2021-07-15 17:31:30.000000000 
+0200
+++ new/elasticsearch-dsl-py-7.4.1/setup.py     2023-03-01 21:46:54.000000000 
+0100
@@ -20,7 +20,7 @@
 
 from setuptools import find_packages, setup
 
-VERSION = (7, 4, 0)
+VERSION = (7, 4, 1)
 __version__ = VERSION
 __versionstr__ = ".".join(map(str, VERSION))
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/elasticsearch-dsl-py-7.4.0/tests/test_integration/test_document.py 
new/elasticsearch-dsl-py-7.4.1/tests/test_integration/test_document.py
--- old/elasticsearch-dsl-py-7.4.0/tests/test_integration/test_document.py      
2021-07-15 17:31:30.000000000 +0200
+++ new/elasticsearch-dsl-py-7.4.1/tests/test_integration/test_document.py      
2023-03-01 21:46:54.000000000 +0100
@@ -15,6 +15,7 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
+import warnings
 from datetime import datetime
 from ipaddress import ip_address
 
@@ -407,7 +408,11 @@
 def test_update_works_from_search_response(data_client):
     elasticsearch_repo = Repository.search().execute()[0]
 
-    elasticsearch_repo.update(owner={"other_name": "elastic"})
+    with warnings.catch_warnings(record=True) as w:
+        elasticsearch_repo.update(owner={"other_name": "elastic"})
+    assert [
+        str(x.message) for x in w if issubclass(x.category, DeprecationWarning)
+    ] == []
     assert "elastic" == elasticsearch_repo.owner.other_name
 
     new_version = Repository.get("elasticsearch-dsl-py")
@@ -442,7 +447,12 @@
 
     elasticsearch_repo.new_field = "testing-save"
     old_seq_no = elasticsearch_repo.meta.seq_no
-    assert "updated" == elasticsearch_repo.save()
+
+    with warnings.catch_warnings(record=True) as w:
+        assert "updated" == elasticsearch_repo.save()
+    assert [
+        str(x.message) for x in w if issubclass(x.category, DeprecationWarning)
+    ] == []
 
     new_repo = data_client.get(index="git", id="elasticsearch-dsl-py")
     assert "testing-save" == new_repo["_source"]["new_field"]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/elasticsearch-dsl-py-7.4.0/tests/test_integration/test_index.py 
new/elasticsearch-dsl-py-7.4.1/tests/test_integration/test_index.py
--- old/elasticsearch-dsl-py-7.4.0/tests/test_integration/test_index.py 
2021-07-15 17:31:30.000000000 +0200
+++ new/elasticsearch-dsl-py-7.4.1/tests/test_integration/test_index.py 
2023-03-01 21:46:54.000000000 +0100
@@ -15,6 +15,8 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
+import warnings
+
 from elasticsearch_dsl import Date, Document, Index, IndexTemplate, Text, 
analysis
 
 
@@ -65,7 +67,12 @@
     i = Index("test-blog", using=write_client)
     i.document(Post)
     i.settings(number_of_replicas=0, number_of_shards=1)
-    i.create()
+
+    with warnings.catch_warnings(record=True) as w:
+        i.create()
+    assert [
+        str(x.message) for x in w if issubclass(x.category, DeprecationWarning)
+    ] == []
 
     assert {
         "test-blog": {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/elasticsearch-dsl-py-7.4.0/tests/test_integration/test_search.py 
new/elasticsearch-dsl-py-7.4.1/tests/test_integration/test_search.py
--- old/elasticsearch-dsl-py-7.4.0/tests/test_integration/test_search.py        
2021-07-15 17:31:30.000000000 +0200
+++ new/elasticsearch-dsl-py-7.4.1/tests/test_integration/test_search.py        
2023-03-01 21:46:54.000000000 +0100
@@ -18,6 +18,8 @@
 
 from __future__ import unicode_literals
 
+import warnings
+
 from elasticsearch import TransportError
 from pytest import raises
 
@@ -169,3 +171,14 @@
     authors = r.aggregations.authors
     assert 1 == len(authors)
     assert {"key": "Honza Král", "doc_count": 52} == authors[0]
+
+
+def test_no_deprecation_warnings(data_client):
+    s = Search(index="git")[0:0]
+    s.aggs.bucket("authors", "terms", field="author.name.raw", size=1)
+
+    with warnings.catch_warnings(record=True) as w:
+        s.execute()
+    assert [
+        str(x.message) for x in w if issubclass(x.category, DeprecationWarning)
+    ] == []
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/elasticsearch-dsl-py-7.4.0/tests/test_search.py 
new/elasticsearch-dsl-py-7.4.1/tests/test_search.py
--- old/elasticsearch-dsl-py-7.4.0/tests/test_search.py 2021-07-15 
17:31:30.000000000 +0200
+++ new/elasticsearch-dsl-py-7.4.1/tests/test_search.py 2023-03-01 
21:46:54.000000000 +0100
@@ -20,6 +20,7 @@
 from pytest import raises
 
 from elasticsearch_dsl import Document, Q, query, search
+from elasticsearch_dsl.connections import CLIENT_HAS_NAMED_BODY_PARAMS
 from elasticsearch_dsl.exceptions import IllegalOperation
 
 
@@ -43,7 +44,10 @@
     s._response = r
     s.execute(ignore_cache=True)
 
-    mock_client.search.assert_called_once_with(index=None, body={})
+    if CLIENT_HAS_NAMED_BODY_PARAMS:
+        mock_client.search.assert_called_once_with(index=None)
+    else:
+        mock_client.search.assert_called_once_with(index=None, body={})
 
 
 def test_iter_iterates_over_hits():
@@ -411,7 +415,10 @@
     s = s.params(routing="42")
     s.execute()
 
-    mock_client.search.assert_called_once_with(index=None, body={}, 
routing="42")
+    if CLIENT_HAS_NAMED_BODY_PARAMS:
+        mock_client.search.assert_called_once_with(index=None, routing="42")
+    else:
+        mock_client.search.assert_called_once_with(index=None, body={}, 
routing="42")
 
 
 def test_source():

Reply via email to