From 7b06cedc8a4d84f2028b82e8f0ed7312e7c8d47c2e9eb5442b5242ccdd3abe51 Mon Sep 17 00:00:00 2001 From: Daniel Garcia Date: Wed, 8 Jan 2025 08:56:10 +0000 Subject: [PATCH 1/2] - Skip some flaky tests that fails in OBS build OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-elasticsearch?expand=0&rev=49 --- .gitattributes | 23 ++ .gitignore | 1 + python-elasticsearch.changes | 443 +++++++++++++++++++++++++++++++++++ python-elasticsearch.spec | 76 ++++++ v8.12.0.tar.gz | 3 + 5 files changed, 546 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 python-elasticsearch.changes create mode 100644 python-elasticsearch.spec create mode 100644 v8.12.0.tar.gz diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/python-elasticsearch.changes b/python-elasticsearch.changes new file mode 100644 index 0000000..0a86586 --- /dev/null +++ b/python-elasticsearch.changes @@ -0,0 +1,443 @@ +------------------------------------------------------------------- +Wed Jan 8 08:55:50 UTC 2025 - Daniel Garcia + +- Skip some flaky tests that fails in OBS build + +------------------------------------------------------------------- +Sat Jan 20 12:38:49 UTC 2024 - Dirk Müller + +- update to 8.12.0: + * Dropped support for Python 3.6 + * Allowed unrestricted `body` parameter again (see #2383 for + details) + * Added the Inference APIs + * Added the ES|QL API + * Added `active_only` parameter to `security.get_api_key` API + * Added `expiration` parameter to `security.update_api_key` API + +------------------------------------------------------------------- +Wed Dec 27 10:02:59 UTC 2023 - Dirk Müller + +- update to 8.11.1: + * Added missing `role_templates` to `security.put_role_mapping` + API + * Added interactive examples page to documentation + * Changed API reference to have one page per sub-client + +------------------------------------------------------------------- +Mon Nov 27 18:55:59 UTC 2023 - Dirk Müller + +- update to 8.11.0: + * Added support for Python 3.12 + * Added missing `scores` parameter to create trained model + vocabulary API + * Added missing `delete_dest_index` parameter to delete + transform API + * Removed deprecation warnings when using `body` parameter + * Fixed some type hints to use covariant Sequence instead of + invariant List (#2324, #2325) + +------------------------------------------------------------------- +Mon Oct 2 10:27:22 UTC 2023 - Dirk Müller + +- update to 8.10.0: + * Add the Query rules APIs + * Add the Synonyms APIs + +------------------------------------------------------------------- +Fri Sep 1 16:36:50 UTC 2023 - Matej Cepl + +- Update to 8.9.0: + Number of changes is so large, that I suggest looking at it at + https://www.elastic.co/guide/en/elasticsearch/client/python-api/master/release-notes.html. +- Remove upstreamed python-elasticsearch-no-nose.patch and + python-elasticsearch-no-mock.patch. + +------------------------------------------------------------------- +Fri Apr 21 12:24:36 UTC 2023 - Dirk Müller + +- add sle15_python_module_pythons (jsc#PED-68) +- Remove upstreamed python-elasticsearch-no-mock.patch. + +------------------------------------------------------------------- +Thu Apr 13 22:41:05 UTC 2023 - Matej Cepl + +- Make calling of %{sle15modernpython} optional. + +------------------------------------------------------------------- +Tue Oct 18 10:04:37 UTC 2022 - Matej Cepl + +- Revert back to 7.6.0. elasticsearch-dsl is not compatible with + 8.* releases (gh#elastic/elasticsearch-dsl-py#1569). +- Add python-elasticsearch-no-nose.patch to replace sed call in + SPEC file. + +------------------------------------------------------------------- +Thu Aug 18 16:35:28 UTC 2022 - Ben Greiner + +- Update to 8.3.3 + * Client is compatible with Elasticsearch 8.3.3 +- Release 8.3.2 + + Security + * Added the refresh parameter to the + security.create_service_token API. +- Release 8.3.1 + + Security + * Added the experimental security.has_privileges_user_profile + API + * Added the hint parameter to the experimental + security.suggest_user_profiles API +- Release 8.3.0 + * Client is compatible with Elasticsearch 8.3.0 +- Release 8.2.3 + + Documents + * Added the routing parameter to the msearch API. + + CAT + * Added the cat.component_templates API. + + Ingest + * Added the if_version parameter to the ingest.put_pipeline + API. + + Security + * Changed the name parameter for the + security.create_service_token API from required to optional. + * Added the refresh parameter to the + security.create_service_token API. + * Changed the name of access parameter to the labels parameter + in the security.update_user_profile_data API. + + Shutdown + * Added the timeout and master_timeout parameters to the + shutdown.get_node, shutdown.delete_node, and + shutdown.put_node APIs. + * Added the reason, type, allocation_delay, and + target_node_name parameters to the shutdown.put_node API. +- Release 8.2.2 + * Client is compatible with Elasticsearch 8.2.2 +- Release 8.2.1 + + Machine Learning + * Added the inference_config parameter to the + ml.infer_trained_model_deployment API +- Release 8.2.0 + + Client + * Re-introduced support for passing requests.auth.BaseAuth + objects to the http_auth parameter which was available in + 7.x. + + Search + * Added the filter parameter to the experimental knn_search API + + Documents + * Changed the source and dest parameters for the reindex API + from optional to required + + Indices + * Added the indices.field_usage_stats API + * Added the indices.modify_data_stream API + * Added the fields and types parameters to the field_caps API + * Added the ignore_unvailable parameter to the + open_point_in_time API + * Added the master_timeout and timeout parameters to the + indices.delete API + * Added the features parameter to the indices.get API + + Machine Learning + * Added the ml.get_memory_stats API + + Migrations + * Added the migrations.get_feature_upgrade_status API + * Added the migrations.post_feature_upgrade API + + Nodes + * Added the nodes.clear_repositories_metering_archive API + * Added the nodes.get_repositories_metering_info API + + Security + * Added the beta security.activate_user_profile API + * Added the beta security.disable_user_profile API + * Added the beta security.enable_user_profile API + * Added the beta security.get_user_profile API + * Added the beta security.suggest_user_profiles API + * Added the beta security.update_user_profile_data API + + SQL + * Added the catalog, index_using_frozen, keep_alive, + keep_on_completion, runtime_mappings, and + wait_for_completion_timeout parameters to the sql.query API +- Release 8.1.2 + * Client is compatible with Elasticsearch 8.1.2 +- Release 8.1.1 + + Documents + * Changed the source and dest parameters of the reindex API to + be required. + + Mappings + * Changed the fields parameter of the field_caps API to be + required. +- Release 8.1.0 + + Transforms + * Added the transform.reset_transform API +- Release 8.0.0 + + Added + * Added the top-level .options() method to Elasticsearch and + AsyncElasticsearch for modifying transport options. + * Added parameters corresponding to JSON request body fields + for all APIs + * Added basic_auth parameter for specifying username and + password authentication + * Added bearer_auth parameter for specifying an HTTP bearer + token or service token + * Added the meta property to ApiError to access the HTTP + response metadata of an error. + * Added a check that a compatible version of the + elastic-transport package is installed. + * Changed + * Changed the transport layer to use the elastic-transport + package + * Changed user-defined body parameters to have semantic names + (e.g index(document={...}) instead of index(body={...})). + * Changed responses to be objects with two properties, meta for + response metadata (HTTP status, headers, node, etc) and body + for a typed body. + * Changed AsyncElasticsearch to always be available, regardless + of whether aiohttp is installed + * Changed exception hierarchy, the major change is a new + exception ApiError which differentiates between an error + that’s raised from the transport layer (previously + elasticsearch.exceptions.TransportError, now + elastic_transport.TransportError) and one raised from the API + layer + * Changed the name of JSONSerializer to JsonSerializer for + consistency with other serializer names. Added an alias to + the old name for backwards compatibility + * Changed the default mimetypes (application/json) to instead + use compatibility mimetypes + (application/vnd.elasticsearch+json) which always request for + responses compatibility with version 8.x. + + Removed + * Removed support for Python 2.7 and Python 3.5, the library + now supports only Python 3.6+ + * Removed the elasticsearch.connection module as all + functionality has been moved to the elastic-transport package + * Removed the default URL of http://localhost:9200 due to + Elasticsearch 8.0 default configuration being + https://localhost:9200. The client’s connection to + Elasticsearch now must be specified with scheme, host, and + port or with the cloud_id parameter + * Removed the ability to use positional arguments with API + methods. Going forward all API parameters must be + keyword-only parameters + * Removed the doc_type, include_type_name, and copy_settings + parameters from many document and index APIs + + Deprecated + * Deprecated the body and params parameters on all APIs + * Deprecated setting transport options http_auth, api_key, + ignore, request_timeout, headers, and opaque_id All of these + settings should instead be set via the .options() method + * Deprecated the elasticsearch.transport and + elasticsearch.client modules. These modules will be removed + in a future version + + CAT + * Removed the deprecated local parameter from the cat.indices, + cat.nodes, cat.shards API + * Removed the deprecated allow_no_datafeeds parameter from the + cat.ml_datafeeds API + * Removed the deprecated allow_no_jobs parameter from the + cat.ml_jobs API + * Removed the deprecated size parameter from the + cat.thread_pool API + * Added the time parameter to the cat.thread_pool API + + Documents + * Removed the deprecated size parameter from the + delete_by_query API + * Removed the deprecated size parameter from the + update_by_query API + + Indices + * Removed the deprecated indices.flush_synced API + * Removed the deprecated indices.freeze API + * Removed the deprecated indices.get_upgrade API + * Removed the deprecated indices.upgrade API + * Removed the deprecated indices.exist_type API + * Removed the deprecated parameter copy_settings from the + indices.shrink API + * Deprecated the verbose parameter of the indices.segments API + + License / X-Pack + * Deprecated the accept_enterprise parameter of the license.get + API + * Deprecated the accept_enterprise parameter of the xpack.info + API + + Machine Learning + * Added the experimental ml.infer_trained_model_deployment API + * Added the experimental ml.put_trained_model_definition_part + API + * Added the experimental ml.put_trained_model_vocabulary API + * Added the experimental ml.start_trained_model_deployment API + * Added the experimental ml.stop_trained_model_deployment API + * Added the timeout parameter to the ml.delete_trained_model + API + * Removed the deprecated allow_no_jobs parameter from the + ml.close_job API + * Removed the deprecated ml.find_text_structure API + * Removed the deprecated allow_no_datafeeds parameter from the + ml.get_datafeed_stats API + * Removed the deprecated allow_no_datafeeds parameter from the + ml.get_datafeeds API + * Removed the deprecated allow_no_jobs parameter from the + ml.get_job_stats API + * Removed the deprecated allow_no_jobs parameter from the + ml.get_jobs API + * Removed the deprecated allow_no_jobs parameter from the + ml.get_overall_buckets API + + Search + * Added the experimental knn_search API + * Searchable Snapshots + * Removed the deprecated searchable_snapshots.repository_stats + API + + Snapshots + * Changed the snapshot.delete API to accept multiple snapshots + + Security + * Added the security.enroll_kibana API + * Added the security.enroll_node API + +------------------------------------------------------------------- +Mon May 23 12:08:05 UTC 2022 - pgajdos@suse.com + +- do not require python-mock for build +- added patches + fix https://github.com/elastic/elasticsearch-py/issues/1983 + + python-elasticsearch-no-mock.patch + +------------------------------------------------------------------- +Sun Aug 16 12:33:29 UTC 2020 - John Vandenberg + +- Replace nose with pytest +- Remove %bcond_without test +- Tidy spec + +------------------------------------------------------------------- +Mon Apr 6 07:52:26 UTC 2020 - Marketa Calabkova + +- Update to 7.6.0 + * Added support for ES 7.6 APIs + * Added support for `X-Opaque-Id`_ to identify long-running tasks + * Added support for HTTP compression to ``RequestsHttpConnection`` + * Updated default setting of ``http_compress`` when using ``cloud_id`` to ``True`` + * Updated default setting of ``sniffing`` when using ``cloud_id`` to ``False`` + * Updated default port to ``443`` if ``cloud_id`` and no other port is defined + on the client or within ``cloud_id`` + * Fix regression of ``client.cluster.state()`` where the default ``metric`` + should be set to ``"_all"`` if an index is given (See `#1143`_) + * Fix regression of ``client.tasks.get()`` without a ``task_id`` + having similar functionality to ``client.tasks.list()`` This will + be removed in ``v8.0`` of ``elasticsearch-py`` (See `#1157`_) + +------------------------------------------------------------------- +Mon Mar 2 15:39:59 UTC 2020 - Marketa Calabkova + +- Update to 7.5.1 + * All API is now auto generated + * deprecated the .xpack namespace + * Update client to support ES 7.5 APIs + * Fix sniffing with http.publish_host + * Fix request_timeout for indices APIs + * Allow access to x-pack features without xpack namespace + * Fix verify_certs=False + +------------------------------------------------------------------- +Fri Sep 13 08:03:22 UTC 2019 - Tomáš Chvátal + +- Update to 7.0.4: + * remove sleep in retries + * pass scroll_id through body in scroll + * add user-agent + +------------------------------------------------------------------- +Fri Jun 7 09:21:34 UTC 2019 - Marketa Calabkova + +- update to 7.0.2 + * Add connection parameter for Elastic Cloud cloud_id + * ML client uses client object for _bulk_body requests + * Blocking pool must fit thread_count + * Update client to support missing ES 7 API's and query params. + * Removed deprecated option update_all_types + * Using insecure SSL configuration (verify_cert=False) raises a + warning, this can be not showed with ssl_show_warn=False + * Add support for 7.x api's in Elasticsearch + +------------------------------------------------------------------- +Thu Jan 10 13:18:55 UTC 2019 - Thomas Bechtold + +- update to 6.3.1: + * Removed deprecated option ``update_all_types``. + * Pass retry object instead of False in urllib3 + * Add support for `allow_partial_search_results` + * Deprecate `update_all_types` + * Add an exponential wait on delays + * Fix issues with dependencies + * Adding X-pack Docs + * Adding forecast to x-pack ML client + * cleanup for SSL Context + * Add X-Pack clients to -py + * Adding Gzip support for capacity constrained networks + * ``_routing`` in bulk action has been deprecated in ES. Introduces a breaking change + if you use ``routing`` as a field in your documents. + * Updates to SSLContext logic to make it easier to use and have saner defaults. + * Doc updates + * bad release + +------------------------------------------------------------------- +Tue Dec 4 12:47:36 UTC 2018 - Matej Cepl + +- Remove superfluous devel dependency for noarch package + +------------------------------------------------------------------- +Thu Nov 23 15:32:45 UTC 2017 - mimi.vx@gmail.com + +- fix Source url, use pypi package + +------------------------------------------------------------------- +Thu Nov 23 13:27:11 UTC 2017 - kkaempf@suse.com + +- Update to 6.0.0 + * compatibility with Elasticsearch 6.0.0 + +------------------------------------------------------------------- +Thu Oct 19 00:43:55 UTC 2017 - toddrme2178@gmail.com + +- Implement single-spec version +- Update to version 5.4.0 + * see changelog at https://github.com/elastic/elasticsearch-py/blob/5.4.0/Changelog.rst + +------------------------------------------------------------------- +Tue Feb 14 20:34:21 UTC 2017 - jengelh@inai.de + +- Remove hypothetical wording from description + +------------------------------------------------------------------- +Mon Feb 13 08:47:46 UTC 2017 - tbechtold@suse.com + +- update to 5.2.0: + * The client now automatically sends ``Content-Type`` http header set to + ``application/json``. If you are explicitly passing in other encoding than + ``json`` you need to set the header manually. + * Fixed sniffing + * Fixed performance regression in ``scan`` helper + * when using SSL certificate validation is now on by default. Install + ``certifi`` or supply root certificate bundle. + * ``elasticsearch.trace`` logger now also logs failed requests, signature of + internal logging method ``log_request_fail`` has changed, all custom + connection classes need to be updated + * added ``headers`` arg to connections to support custom http headers + * passing in a keyword parameter with ``None`` as value will cause that param + to be ignored + +------------------------------------------------------------------- +Thu Jan 19 23:36:29 UTC 2017 - dmueller@suse.com + +- update to 2.4.0: + * increase default size for ``scan`` helper to 1000 + * added ``client_key`` argument to configure client certificates + * debug logging now includes response body even for failed requests + * Elasticsearch 2.0 compatibility release + * removed thrift and memcached connections, if you wish to continue using + those, extract the classes and use them separately. + * added a new, parallel version of the bulk helper using thread pools + * In helpers, removed ``bulk_index`` as an alias for ``bulk``. Use ``bulk`` + instead. + * thrift now deprecated, to be removed in future version + * make sure urllib3 always uses keep-alive + +------------------------------------------------------------------- +Wed Apr 29 13:15:43 UTC 2015 - tbechtold@suse.com + +- Initial packaging + diff --git a/python-elasticsearch.spec b/python-elasticsearch.spec new file mode 100644 index 0000000..7ae9b43 --- /dev/null +++ b/python-elasticsearch.spec @@ -0,0 +1,76 @@ +# +# spec file for package python-elasticsearch +# +# Copyright (c) 2025 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%{?sle15_python_module_pythons} +Name: python-elasticsearch +# DO NOT UPDATE until the compatible version of +# python-elasticsearch-dsl is available +Version: 8.12.0 +Release: 0 +Summary: Python client for Elasticsearch +License: Apache-2.0 +Group: Development/Languages/Python +URL: https://github.com/elastic/elasticsearch-py +Source: https://github.com/elastic/elasticsearch-py/archive/refs/tags/v%{version}.tar.gz +BuildRequires: %{python_module certifi} +BuildRequires: %{python_module elastic-transport} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module urllib3 >= 1.21.1} +BuildRequires: %{python_module wheel} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires: python-elastic-transport +BuildArch: noarch +# SECTION test +BuildRequires: %{python_module PyYAML >= 5.4} +BuildRequires: %{python_module aiohttp >= 3 with %python-aiohttp < 4} +BuildRequires: %{python_module pytest-asyncio} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module python-dateutil} +BuildRequires: %{python_module requests >= 2.4 with %python-requests < 3} +# /SECTION +%python_subpackages + +%description +Official low-level client for Elasticsearch. Its goal is to provide common +ground for all Elasticsearch-related code in Python; because of this it tries +to be opinion-free and very extendable. + +%prep +%autosetup -p1 -n elasticsearch-py-%{version} +sed -i '/addopts/d' setup.cfg + +%build +%pyproject_wheel + +%install +%pyproject_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +# Skip some flaky tests that fails in OBS +donttest="test_sniff_uses_sniff_timeout or test_sniff_on_node_failure_triggers" +%pytest -k "not ($donttest)" + +%files %{python_files} +%license LICENSE +%doc CODE_OF_CONDUCT.md CHANGELOG.md README.rst +%{python_sitelib}/elasticsearch +%{python_sitelib}/elasticsearch-%{version}.dist-info + +%changelog diff --git a/v8.12.0.tar.gz b/v8.12.0.tar.gz new file mode 100644 index 0000000..7beef0a --- /dev/null +++ b/v8.12.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4618c879499f01b8b7e46932934bd840829e1d34c2647a496b7503682abe1122 +size 906227 From 82ef2db5fada78853e72e797f150a6f67dabcd4bd102005eca4f39f203474a44 Mon Sep 17 00:00:00 2001 From: Daniel Garcia Date: Wed, 8 Jan 2025 08:59:52 +0000 Subject: [PATCH 2/2] - Add patch to do not depend on pyarrow for tests: 0001-Make-pyarrow-dependency-optional-for-tests.patch - Update to 8.17.0: * Allow simsimd again on Python 3.13 (#2722) * Update APIs: - Mark all Inference APIs as stable. - Add allow_partial_search_results to the Open Point in Time API - Add keep_alive to the Get async search status API - Remove the keep_alive, pre_filter_shard_size and scroll parameters from the Submit async search API. They were never supported. - Add master_timeout and timeout to all autoscaling policy APIs - Add master_timeout to the Alias exists and Get alias APIs - Add list_executed_pipelines and require_data_stream to Bulk API - Add include_model_definition to Get trained models API - Add meta to Create data frame analytics API - Add aggs to Create datafeeds API - Add allow_no_indices, expand_wildcards, ignore_throttled and ignore_unavailable to Create anomaly detection jobs API - 8.16.0: * Support Python 3.13 (#2680) * Emit Python warnings for beta and tech preview APIs (#2675). * Vectorstore: use a retriever query for hybrid search (#2666) * Allow retries for statuses other than 429 in streaming bulk (#2071, contributed by @ayayron) * Make BulkIndexError and ScanError serializable (#2669, contributed by @seagrine) * Fix import when trace is missing from opentelemetry package (#2694, contributed by @nicoloboschi) * Update APIs: - Fix nodes parameter in Task management API (contributed by @margaretpearce) - Add Test query rule API - Add Create Cross-Cluster API key and Update Cross-Cluster API key APIs - Add experimental Verify snapshot repository API - Add data_stream_name and settings to Delete auto-follow pattern API - Add max_samples_per_key to Get async EQL status API - Add lifecycle and remove unused data_retention and downsampling parameters from Put data stream lifecycle API OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-elasticsearch?expand=0&rev=50 --- ...yarrow-dependency-optional-for-tests.patch | 193 ++++++++++++++++++ python-elasticsearch.changes | 82 ++++++++ python-elasticsearch.spec | 10 +- v8.12.0.tar.gz | 3 - v8.17.0.tar.gz | 3 + 5 files changed, 285 insertions(+), 6 deletions(-) create mode 100644 0001-Make-pyarrow-dependency-optional-for-tests.patch delete mode 100644 v8.12.0.tar.gz create mode 100644 v8.17.0.tar.gz diff --git a/0001-Make-pyarrow-dependency-optional-for-tests.patch b/0001-Make-pyarrow-dependency-optional-for-tests.patch new file mode 100644 index 0000000..256b4f5 --- /dev/null +++ b/0001-Make-pyarrow-dependency-optional-for-tests.patch @@ -0,0 +1,193 @@ +From 740005db4dcd732015606d86eff29eb15a0193b2 Mon Sep 17 00:00:00 2001 +From: Daniel Garcia Moreno +Date: Wed, 8 Jan 2025 08:50:23 +0100 +Subject: [PATCH] Make pyarrow dependency optional for tests + +--- + .../test_client/test_deprecated_options.py | 40 ++++++++------- + .../test_client/test_serializers.py | 49 ++++++++----------- + test_elasticsearch/test_serializer.py | 9 +++- + 3 files changed, 48 insertions(+), 50 deletions(-) + +diff --git a/test_elasticsearch/test_client/test_deprecated_options.py b/test_elasticsearch/test_client/test_deprecated_options.py +index 810e75cf..ea797ce8 100644 +--- a/test_elasticsearch/test_client/test_deprecated_options.py ++++ b/test_elasticsearch/test_client/test_deprecated_options.py +@@ -22,6 +22,24 @@ import pytest + from elasticsearch import Elasticsearch, JsonSerializer + + ++EXPECTED_SERIALIZERS = { ++ "application/vnd.mapbox-vector-tile", ++ "application/x-ndjson", ++ "application/json", ++ "text/*", ++ "application/vnd.elasticsearch+json", ++ "application/vnd.elasticsearch+x-ndjson", ++} ++ ++ ++try: ++ import pyarrow as pa ++ EXPECTED_SERIALIZERS.add("application/vnd.apache.arrow.stream") ++except ImportError: ++ pa = None ++ ++ ++ + def test_sniff_on_connection_fail(): + with warnings.catch_warnings(record=True) as w: + client = Elasticsearch("http://localhost:9200", sniff_on_connection_fail=True) +@@ -129,15 +147,7 @@ def test_serializer_and_serializers(): + client.transport.serializers.get_serializer("application/json"), + CustomSerializer, + ) +- assert set(client.transport.serializers.serializers.keys()) == { +- "application/vnd.mapbox-vector-tile", +- "application/x-ndjson", +- "application/json", +- "text/*", +- "application/vnd.apache.arrow.stream", +- "application/vnd.elasticsearch+json", +- "application/vnd.elasticsearch+x-ndjson", +- } ++ assert set(client.transport.serializers.serializers.keys()) == EXPECTED_SERIALIZERS + + client = Elasticsearch( + "http://localhost:9200", +@@ -150,13 +160,5 @@ def test_serializer_and_serializers(): + client.transport.serializers.get_serializer("application/json"), + CustomSerializer, + ) +- assert set(client.transport.serializers.serializers.keys()) == { +- "application/vnd.mapbox-vector-tile", +- "application/x-ndjson", +- "application/json", +- "text/*", +- "application/vnd.apache.arrow.stream", +- "application/vnd.elasticsearch+json", +- "application/vnd.elasticsearch+x-ndjson", +- "application/cbor", +- } ++ expected = EXPECTED_SERIALIZERS | {"application/cbor"} ++ assert set(client.transport.serializers.serializers.keys()) == expected +diff --git a/test_elasticsearch/test_client/test_serializers.py b/test_elasticsearch/test_client/test_serializers.py +index 9d13386e..4b18212d 100644 +--- a/test_elasticsearch/test_client/test_serializers.py ++++ b/test_elasticsearch/test_client/test_serializers.py +@@ -21,6 +21,23 @@ from elasticsearch import Elasticsearch + from test_elasticsearch.test_cases import DummyTransportTestCase + + ++EXPECTED_SERIALIZERS = { ++ "application/json", ++ "text/*", ++ "application/x-ndjson", ++ "application/vnd.mapbox-vector-tile", ++ "application/vnd.elasticsearch+json", ++ "application/vnd.elasticsearch+x-ndjson", ++} ++ ++ ++try: ++ import pyarrow as pa ++ EXPECTED_SERIALIZERS.add("application/vnd.apache.arrow.stream") ++except ImportError: ++ pa = None ++ ++ + class TestSerializers(DummyTransportTestCase): + def test_compat_mode_on_by_default(self): + calls = self.client.transport.calls +@@ -90,16 +107,8 @@ class TestSerializers(DummyTransportTestCase): + "https://localhost:9200", serializers={f"application/{mime_subtype}": ser} + ) + serializers = client.transport.serializers.serializers +- assert set(serializers.keys()) == { +- "application/json", +- "text/*", +- "application/x-ndjson", +- "application/vnd.apache.arrow.stream", +- "application/vnd.mapbox-vector-tile", +- "application/vnd.elasticsearch+json", +- "application/vnd.elasticsearch+x-ndjson", +- } + ++ assert set(serializers.keys()) == EXPECTED_SERIALIZERS + assert serializers[f"application/{mime_subtype}"] is ser + assert serializers[f"application/vnd.elasticsearch+{mime_subtype}"] is ser + +@@ -118,16 +127,7 @@ class TestSerializers(DummyTransportTestCase): + }, + ) + serializers = client.transport.serializers.serializers +- assert set(serializers.keys()) == { +- "application/json", +- "text/*", +- "application/x-ndjson", +- "application/vnd.apache.arrow.stream", +- "application/vnd.mapbox-vector-tile", +- "application/vnd.elasticsearch+json", +- "application/vnd.elasticsearch+x-ndjson", +- } +- ++ assert set(serializers.keys()) == EXPECTED_SERIALIZERS + assert serializers[f"application/{mime_subtype}"] is ser1 + assert serializers[f"application/vnd.elasticsearch+{mime_subtype}"] is ser2 + +@@ -138,15 +138,6 @@ class TestSerializers(DummyTransportTestCase): + ser = CustomSerializer() + client = Elasticsearch("https://localhost:9200", serializer=ser) + serializers = client.transport.serializers.serializers +- assert set(serializers.keys()) == { +- "application/json", +- "text/*", +- "application/x-ndjson", +- "application/vnd.apache.arrow.stream", +- "application/vnd.mapbox-vector-tile", +- "application/vnd.elasticsearch+json", +- "application/vnd.elasticsearch+x-ndjson", +- } +- ++ assert set(serializers.keys()) == EXPECTED_SERIALIZERS + assert serializers["application/json"] is ser + assert serializers["application/vnd.elasticsearch+json"] is ser +diff --git a/test_elasticsearch/test_serializer.py b/test_elasticsearch/test_serializer.py +index 02723e8f..313029ba 100644 +--- a/test_elasticsearch/test_serializer.py ++++ b/test_elasticsearch/test_serializer.py +@@ -19,9 +19,14 @@ import uuid + from datetime import datetime + from decimal import Decimal + +-import pyarrow as pa + import pytest + ++try: ++ import pyarrow as pa ++ from elasticsearch.serializer import PyArrowSerializer ++except ImportError: ++ pa = None ++ + try: + import numpy as np + import pandas as pd +@@ -35,7 +40,6 @@ from elasticsearch.exceptions import SerializationError + from elasticsearch.serializer import ( + JSONSerializer, + OrjsonSerializer, +- PyArrowSerializer, + TextSerializer, + ) + +@@ -163,6 +167,7 @@ def test_serializes_pandas_category(json_serializer): + assert b'{"d":[1,2,3]}' == json_serializer.dumps({"d": cat}) + + ++@pytest.mark.skipif(pa is None, reason="Test requires pyarrow to be available") + def test_pyarrow_loads(): + data = [ + pa.array([1, 2, 3, 4]), +-- +2.47.0 + diff --git a/python-elasticsearch.changes b/python-elasticsearch.changes index 0a86586..15cac04 100644 --- a/python-elasticsearch.changes +++ b/python-elasticsearch.changes @@ -1,3 +1,85 @@ +------------------------------------------------------------------- +Wed Jan 8 08:59:00 UTC 2025 - Daniel Garcia + +- Add patch to do not depend on pyarrow for tests: 0001-Make-pyarrow-dependency-optional-for-tests.patch +- Update to 8.17.0: + * Allow simsimd again on Python 3.13 (#2722) + * Update APIs: + - Mark all Inference APIs as stable. + - Add allow_partial_search_results to the Open Point in Time API + - Add keep_alive to the Get async search status API + - Remove the keep_alive, pre_filter_shard_size and scroll parameters from the Submit async search API. They were never supported. + - Add master_timeout and timeout to all autoscaling policy APIs + - Add master_timeout to the Alias exists and Get alias APIs + - Add list_executed_pipelines and require_data_stream to Bulk API + - Add include_model_definition to Get trained models API + - Add meta to Create data frame analytics API + - Add aggs to Create datafeeds API + - Add allow_no_indices, expand_wildcards, ignore_throttled and ignore_unavailable to Create anomaly detection jobs API +- 8.16.0: + * Support Python 3.13 (#2680) + * Emit Python warnings for beta and tech preview APIs (#2675). + * Vectorstore: use a retriever query for hybrid search (#2666) + * Allow retries for statuses other than 429 in streaming bulk (#2071, contributed by @ayayron) + * Make BulkIndexError and ScanError serializable (#2669, contributed by @seagrine) + * Fix import when trace is missing from opentelemetry package (#2694, contributed by @nicoloboschi) + * Update APIs: + - Fix nodes parameter in Task management API (contributed by @margaretpearce) + - Add Test query rule API + - Add Create Cross-Cluster API key and Update Cross-Cluster API key APIs + - Add experimental Verify snapshot repository API + - Add data_stream_name and settings to Delete auto-follow pattern API + - Add max_samples_per_key to Get async EQL status API + - Add lifecycle and remove unused data_retention and downsampling parameters from Put data stream lifecycle API + - Add include_remotes and remove flat_settings from Cluster stats API + - Add remote_indices to Create or update application privileges and Create or update roles APIs +- 8.15.1: + * Fix OTel context loss in parallel bulk helper (#2616) + * Use request converter to generate python examples (#2645) + * Add Geoip database configuration APIs: Create or update, Get and Delete + * Add q parameter to Update by Query API + * Add allow_no_indices and ignore_unavailable parameters to Resolve index API +- 8.15.0: + * Added the Connector API (#2623) + * Added support for semantic_text and semantic query. + * Added support for sequences of job id, model id and tags where applicable in ML APIs + * Added dry_run and force parameters to the Perform inference API + * Added optional Arrow deserialization support (#2632) + * Merged Query Ruleset API into new Query Rules API (#2607) + * Added mapping code examples (#2596) + * Fixed reference docs (#2629) + * Dropped Python 3.7 support (#2618) +- 8.14.0: + * Fixed node_pool_class override (#2581, contributed by @tallakh) + * Added retriever to the Search API + * Added deprecated and removed allow_auto_create from the Create or update component template API + * Added allow_auto_create, cause, deprecated, ignore_missing_component_templates and master_timeout to the Create or update index template API + * Added cause, removed flat_settings and timeout from the Create or update index template legacy API + * Removed various unsupported parameters from the Simulate index API + * Added various supported paramters to the Simulate index template API + * Added the completion and rerank task types to the Inference APIs + * Added the query and timeout parameters to the Perform inference API + * Added typed_keys to the Search Application Search API + * Added with_profile_uid to the Get API key information and Query API key information APIs +- 8.13.2: + * Added the ml.update_trained_model_deployment API + * Marked Requests 2.32.2 as incompatible with the Elasticsearch client +- 8.13.1: + * Added force_synthetic_source to the Get API + * Added wait_for_completion to the Create trained model API + * Added typed_keys to the Query API key information API +- 8.13.0: + * Added native OpenTelemetry support (#2435) + * Added optional orjson (a fast, correct JSON library) serialization support (#2493) + * Added the text_structure.test_grok_pattern API + * Added the indices.resolve_cluster API + * Renamed the model_id parameter to inference_id in the inference APIs + * Changed all synonyms APIs from experimental to stable. + * Fixed API key documentation (#2477, contributed by @iuliaferoli) +- 8.12.1: + * Fixed but deprecated parameter aliases in body parameter (#2427) + * Added mappings and bulk to quickstart page (#2417) + ------------------------------------------------------------------- Wed Jan 8 08:55:50 UTC 2025 - Daniel Garcia diff --git a/python-elasticsearch.spec b/python-elasticsearch.spec index 7ae9b43..f25a07c 100644 --- a/python-elasticsearch.spec +++ b/python-elasticsearch.spec @@ -20,15 +20,18 @@ Name: python-elasticsearch # DO NOT UPDATE until the compatible version of # python-elasticsearch-dsl is available -Version: 8.12.0 +Version: 8.17.0 Release: 0 Summary: Python client for Elasticsearch License: Apache-2.0 Group: Development/Languages/Python URL: https://github.com/elastic/elasticsearch-py Source: https://github.com/elastic/elasticsearch-py/archive/refs/tags/v%{version}.tar.gz +# PATCH-FIX-UPSTREAM 0001-Make-pyarrow-dependency-optional-for-tests.patch gh#elastic/elasticsearch-py#2733 +Patch1: 0001-Make-pyarrow-dependency-optional-for-tests.patch BuildRequires: %{python_module certifi} BuildRequires: %{python_module elastic-transport} +BuildRequires: %{python_module hatchling} BuildRequires: %{python_module pip} BuildRequires: %{python_module urllib3 >= 1.21.1} BuildRequires: %{python_module wheel} @@ -39,6 +42,7 @@ BuildArch: noarch # SECTION test BuildRequires: %{python_module PyYAML >= 5.4} BuildRequires: %{python_module aiohttp >= 3 with %python-aiohttp < 4} +BuildRequires: %{python_module orjson} BuildRequires: %{python_module pytest-asyncio} BuildRequires: %{python_module pytest} BuildRequires: %{python_module python-dateutil} @@ -69,8 +73,8 @@ donttest="test_sniff_uses_sniff_timeout or test_sniff_on_node_failure_triggers" %files %{python_files} %license LICENSE -%doc CODE_OF_CONDUCT.md CHANGELOG.md README.rst +%doc CODE_OF_CONDUCT.md CHANGELOG.md README.md %{python_sitelib}/elasticsearch -%{python_sitelib}/elasticsearch-%{version}.dist-info +%{python_sitelib}/elasticsearch-%{version}*-info %changelog diff --git a/v8.12.0.tar.gz b/v8.12.0.tar.gz deleted file mode 100644 index 7beef0a..0000000 --- a/v8.12.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4618c879499f01b8b7e46932934bd840829e1d34c2647a496b7503682abe1122 -size 906227 diff --git a/v8.17.0.tar.gz b/v8.17.0.tar.gz new file mode 100644 index 0000000..107217c --- /dev/null +++ b/v8.17.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d9b7dc483f66a7549d56ce5d34801b408b512cce8f319c51d82bd302cd592e63 +size 1604639