Skip to content

Commit d9442d0

Browse files
authored
Release 9.0.0 (#2918)
1 parent 482170d commit d9442d0

File tree

9 files changed

+93
-46
lines changed

9 files changed

+93
-46
lines changed

docs/release-notes/index.md

+50-3
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,57 @@ To check for security updates, go to [Security announcements for the Elastic sta
1818
% *
1919

2020
% ### Fixes [elasticsearch-python-client-next-fixes]
21-
% *
2221

23-
## 9.0.0 [elasticsearch-python-client-900-release-notes]
22+
## 9.0.0 (2025-04-15) [elasticsearch-python-client-900-release-notes]
23+
24+
* Remove deprecated `Elasticsearch()` options ([#2840](https://github.com/elastic/elasticsearch-py/pull/2840))
25+
* Remove deprecated `url_prefix` and `use_ssl` options ([#2797](https://github.com/elastic/elasticsearch-py/pull/2797))
26+
* Merge `Elasticsearch-DSL <https://github.com/elastic/elasticsearch-dsl-py/>`_ package ([#2736](https://github.com/elastic/elasticsearch-py/pull/2736))
27+
* Add Python DSL documentation ([#2761](https://github.com/elastic/elasticsearch-py/pull/2761))
28+
* Autogenerate DSL field classes from schema ([#2780](https://github.com/elastic/elasticsearch-py/pull/2780))
29+
* Improve DSL documentation examples with class-based queries and type hints ([#2857](https://github.com/elastic/elasticsearch-py/pull/2857))
30+
* Document the use of `param()` in Python DSL methods ([#2861](https://github.com/elastic/elasticsearch-py/pull/2861))
31+
* Migrate documentation from AsciiDoc to Markdown format ([#2806](https://github.com/elastic/elasticsearch-py/pull/2806))
32+
* Document use of sub-clients ([#2798](https://github.com/elastic/elasticsearch-py/pull/2798))
33+
* Document how to making API calls ([#2843](https://github.com/elastic/elasticsearch-py/pull/2843))
34+
* Fix `simulate` sub-client documentation ([#2749](https://github.com/elastic/elasticsearch-py/pull/2749))
35+
* Update APIs
36+
* Remove deprecated `/_knn_search` API
37+
* Remove Unfreeze an index API
38+
* Remove min_compatible_shard_node from Search and Async Search Submit APIs
39+
* Remove local parameter from cat alias, Alias exists, and Get alias APIs
40+
* Remove `verbose` from Index segments API
41+
* Remove `include_model_definition` from Get trained model configuration info API
42+
* Remove `wait_for_active_shards` from experimental Get field usage stats API
43+
* Support soft-deletes in connectors:
44+
* Add `hard` to Delete connector API
45+
* Add `include_deleted` to Get and List Connector APIs
46+
* Add `master_timeout` to Migrate to data tiers routing APIs
47+
* Add `master_timeout` to the Alias exists and Get alias APIs.
48+
* Add `expand_wildcards` to Create snapshot API
49+
* Rename incorrect `access_token` to `token` in Logout of OpenID Connect API
50+
* Add inference APIs: Alibaba Cloud AI Search, Amazon Bedrock, Anthropic, Azure AI Studio, Azure OpenAI, Cohere, Elastic Inference Service (EIS), Elasticsearch, ELSER, Google AI Studio, Google Vertex AI, Hugging Face, Jina AI, Mistral, OpenAI, and Voyage AI
51+
* Add Elastic Inference Service (EIS) chat completion API
52+
* Add Reindex legacy backing indices APIs
53+
* Add Create an index from a source index API
54+
* Add `include_source_on_error` to Create, Index, Update and Bulk APIs
55+
* Add Stop async ES|QL query API
56+
* Add `timeout` to Resolve Cluster API
57+
* Add `adaptive_allocations` body field to Start and Update a trained model deployment API
58+
* Rename `index_template_subtitutions` to `index_template_substitutions` in Simulate data ingestion API* Add `if_primary_term`, `if_seq_no`, `op_type`, `require_alias` and `require_data_stream` to Create API
59+
* Add `max_concurrent_shard_requests` to Open point in time API
60+
* Add `local` and `flat_settings` to Check index templates API
61+
* Add `reopen` to Update index settings API
62+
* Add `resource` to Reload search analyzer API
63+
* Add `lazy` to Roll over to a new index API
64+
* Add `cause` and `create` to Simulate index template APIs
65+
* Add Elastic Inference Service (EIS) chat completion
66+
* Add inference APIs: Alibaba Cloud AI Search, Amazon Bedrock, Anthropic, Azure AI Studio, Azure OpenAI, Cohere, Elastic Inference Service (EIS), Elasticsearch, ELSER, Google AI Studio, Google Vertex AI, Hugging Face, Jina AI, Mistral, OpenAI, and Voyage AI
67+
* Update DSL
68+
* Add `ignore_malformed`, `script`, `on_script_error` and `time_series_dimension` to Boolean field
69+
* Add `index` to GeoShape field
70+
* Add `search_inference_id` to SemanticText field
2471

2572
### Features and enhancements [elasticsearch-python-client-900-features-enhancements]
2673

27-
### Fixes [elasticsearch-python-client-900-fixes]
74+
### Fixes [elasticsearch-python-client-900-fixes]

elasticsearch/_async/client/_base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ async def sniff_callback(
174174
"GET",
175175
"/_nodes/_all/http",
176176
headers={
177-
"accept": "application/vnd.elasticsearch+json; compatible-with=8"
177+
"accept": "application/vnd.elasticsearch+json; compatible-with=9"
178178
},
179179
request_timeout=(
180180
sniff_options.sniff_timeout

elasticsearch/_sync/client/_base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def sniff_callback(
174174
"GET",
175175
"/_nodes/_all/http",
176176
headers={
177-
"accept": "application/vnd.elasticsearch+json; compatible-with=8"
177+
"accept": "application/vnd.elasticsearch+json; compatible-with=9"
178178
},
179179
request_timeout=(
180180
sniff_options.sniff_timeout

elasticsearch/_version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
__versionstr__ = "8.17.2"
18+
__versionstr__ = "9.0.0"

test_elasticsearch/test_async/test_transport.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ async def test_client_meta_header_not_sent(self):
256256
calls = client.transport.node_pool.get().calls
257257
assert 1 == len(calls)
258258
assert calls[0][1]["headers"] == {
259-
"accept": "application/vnd.elasticsearch+json; compatible-with=8",
259+
"accept": "application/vnd.elasticsearch+json; compatible-with=9",
260260
}
261261

262262
async def test_body_surrogates_replaced_encoded_into_bytes(self):
@@ -426,7 +426,7 @@ async def test_sniff_on_start_ignores_sniff_timeout(self):
426426
{
427427
"body": None,
428428
"headers": {
429-
"accept": "application/vnd.elasticsearch+json; compatible-with=8"
429+
"accept": "application/vnd.elasticsearch+json; compatible-with=9"
430430
},
431431
"request_timeout": None, # <-- Should be None instead of 12
432432
},
@@ -454,7 +454,7 @@ async def test_sniff_uses_sniff_timeout(self):
454454
{
455455
"body": None,
456456
"headers": {
457-
"accept": "application/vnd.elasticsearch+json; compatible-with=8",
457+
"accept": "application/vnd.elasticsearch+json; compatible-with=9",
458458
},
459459
"request_timeout": DEFAULT,
460460
},
@@ -464,7 +464,7 @@ async def test_sniff_uses_sniff_timeout(self):
464464
{
465465
"body": None,
466466
"headers": {
467-
"accept": "application/vnd.elasticsearch+json; compatible-with=8"
467+
"accept": "application/vnd.elasticsearch+json; compatible-with=9"
468468
},
469469
"request_timeout": 12,
470470
},
@@ -681,7 +681,7 @@ async def test_unsupported_product_error(headers):
681681
{
682682
"body": None,
683683
"headers": {
684-
"accept": "application/vnd.elasticsearch+json; compatible-with=8",
684+
"accept": "application/vnd.elasticsearch+json; compatible-with=9",
685685
},
686686
"request_timeout": DEFAULT,
687687
},

test_elasticsearch/test_client/test_options.py

+17-17
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def test_options_passed_to_perform_request(self):
156156
assert isinstance(call.pop("otel_span"), OpenTelemetrySpan)
157157
assert call == {
158158
"headers": {
159-
"accept": "application/vnd.elasticsearch+json; compatible-with=8",
159+
"accept": "application/vnd.elasticsearch+json; compatible-with=9",
160160
},
161161
"body": None,
162162
}
@@ -175,7 +175,7 @@ def test_options_passed_to_perform_request(self):
175175
assert isinstance(call.pop("otel_span"), OpenTelemetrySpan)
176176
assert call == {
177177
"headers": {
178-
"accept": "application/vnd.elasticsearch+json; compatible-with=8",
178+
"accept": "application/vnd.elasticsearch+json; compatible-with=9",
179179
},
180180
"body": None,
181181
"request_timeout": 1,
@@ -201,7 +201,7 @@ def test_options_passed_to_perform_request(self):
201201
assert isinstance(call.pop("otel_span"), OpenTelemetrySpan)
202202
assert call == {
203203
"headers": {
204-
"accept": "application/vnd.elasticsearch+json; compatible-with=8",
204+
"accept": "application/vnd.elasticsearch+json; compatible-with=9",
205205
},
206206
"body": None,
207207
"request_timeout": 1,
@@ -229,7 +229,7 @@ async def test_options_passed_to_async_perform_request(self):
229229
assert isinstance(call.pop("otel_span"), OpenTelemetrySpan)
230230
assert call == {
231231
"headers": {
232-
"accept": "application/vnd.elasticsearch+json; compatible-with=8",
232+
"accept": "application/vnd.elasticsearch+json; compatible-with=9",
233233
},
234234
"body": None,
235235
}
@@ -248,7 +248,7 @@ async def test_options_passed_to_async_perform_request(self):
248248
assert isinstance(call.pop("otel_span"), OpenTelemetrySpan)
249249
assert call == {
250250
"headers": {
251-
"accept": "application/vnd.elasticsearch+json; compatible-with=8",
251+
"accept": "application/vnd.elasticsearch+json; compatible-with=9",
252252
},
253253
"body": None,
254254
"request_timeout": 1,
@@ -274,7 +274,7 @@ async def test_options_passed_to_async_perform_request(self):
274274
assert isinstance(call.pop("otel_span"), OpenTelemetrySpan)
275275
assert call == {
276276
"headers": {
277-
"accept": "application/vnd.elasticsearch+json; compatible-with=8",
277+
"accept": "application/vnd.elasticsearch+json; compatible-with=9",
278278
},
279279
"body": None,
280280
"request_timeout": 1,
@@ -316,7 +316,7 @@ def test_http_headers_overrides(self):
316316

317317
assert call["headers"] == {
318318
"key": "val",
319-
"accept": "application/vnd.elasticsearch+json; compatible-with=8",
319+
"accept": "application/vnd.elasticsearch+json; compatible-with=9",
320320
}
321321

322322
client.options(headers={"key1": "val"}).indices.get(index="2")
@@ -325,15 +325,15 @@ def test_http_headers_overrides(self):
325325
assert call["headers"] == {
326326
"key": "val",
327327
"key1": "val",
328-
"accept": "application/vnd.elasticsearch+json; compatible-with=8",
328+
"accept": "application/vnd.elasticsearch+json; compatible-with=9",
329329
}
330330

331331
client.options(headers={"key": "val2"}).indices.get(index="3")
332332
call = calls[("GET", "/3")][0]
333333

334334
assert call["headers"] == {
335335
"key": "val2",
336-
"accept": "application/vnd.elasticsearch+json; compatible-with=8",
336+
"accept": "application/vnd.elasticsearch+json; compatible-with=9",
337337
}
338338

339339
client = Elasticsearch(
@@ -360,14 +360,14 @@ def test_user_agent_override(self):
360360
call = calls[("GET", "/1")][0]
361361
assert call["headers"] == {
362362
"user-agent": "custom1",
363-
"accept": "application/vnd.elasticsearch+json; compatible-with=8",
363+
"accept": "application/vnd.elasticsearch+json; compatible-with=9",
364364
}
365365

366366
client.indices.get(index="2", headers={"user-agent": "custom2"})
367367
call = calls[("GET", "/2")][0]
368368
assert call["headers"] == {
369369
"user-agent": "custom2",
370-
"accept": "application/vnd.elasticsearch+json; compatible-with=8",
370+
"accept": "application/vnd.elasticsearch+json; compatible-with=9",
371371
}
372372

373373
client = Elasticsearch(
@@ -381,14 +381,14 @@ def test_user_agent_override(self):
381381
call = calls[("GET", "/1")][0]
382382
assert call["headers"] == {
383383
"user-agent": "custom3",
384-
"accept": "application/vnd.elasticsearch+json; compatible-with=8",
384+
"accept": "application/vnd.elasticsearch+json; compatible-with=9",
385385
}
386386

387387
client.indices.get(index="2", headers={"user-agent": "custom4"})
388388
call = calls[("GET", "/2")][0]
389389
assert call["headers"] == {
390390
"user-agent": "custom4",
391-
"accept": "application/vnd.elasticsearch+json; compatible-with=8",
391+
"accept": "application/vnd.elasticsearch+json; compatible-with=9",
392392
}
393393

394394
def test_options_timeout_parameters(self):
@@ -410,7 +410,7 @@ def test_options_timeout_parameters(self):
410410
assert isinstance(call.pop("otel_span"), OpenTelemetrySpan)
411411
assert call == {
412412
"headers": {
413-
"accept": "application/vnd.elasticsearch+json; compatible-with=8",
413+
"accept": "application/vnd.elasticsearch+json; compatible-with=9",
414414
},
415415
"body": None,
416416
"request_timeout": 1,
@@ -440,7 +440,7 @@ def test_options_timeout_parameters(self):
440440
assert isinstance(call.pop("otel_span"), OpenTelemetrySpan)
441441
assert call == {
442442
"headers": {
443-
"accept": "application/vnd.elasticsearch+json; compatible-with=8",
443+
"accept": "application/vnd.elasticsearch+json; compatible-with=9",
444444
},
445445
"body": None,
446446
"request_timeout": 2,
@@ -465,7 +465,7 @@ def test_options_timeout_parameters(self):
465465
assert isinstance(call.pop("otel_span"), OpenTelemetrySpan)
466466
assert call == {
467467
"headers": {
468-
"accept": "application/vnd.elasticsearch+json; compatible-with=8",
468+
"accept": "application/vnd.elasticsearch+json; compatible-with=9",
469469
},
470470
"body": None,
471471
}
@@ -487,7 +487,7 @@ def test_options_timeout_parameters(self):
487487
assert isinstance(call.pop("otel_span"), OpenTelemetrySpan)
488488
assert call == {
489489
"headers": {
490-
"accept": "application/vnd.elasticsearch+json; compatible-with=8",
490+
"accept": "application/vnd.elasticsearch+json; compatible-with=9",
491491
},
492492
"body": None,
493493
"request_timeout": 1,

test_elasticsearch/test_client/test_serializers.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -46,38 +46,38 @@ def test_compat_mode_on_by_default(self):
4646
self.client.get(index="test0", id="1")
4747
assert len(calls) == 1
4848
assert calls[("GET", "/test0/_doc/1")][0]["headers"] == {
49-
"Accept": "application/vnd.elasticsearch+json; compatible-with=8"
49+
"Accept": "application/vnd.elasticsearch+json; compatible-with=9"
5050
}
5151

5252
# Search with body
5353
self.client.search(index="test1", query={"match_all": {}})
5454
assert len(calls) == 2
5555
assert calls[("POST", "/test1/_search")][0]["headers"] == {
56-
"Accept": "application/vnd.elasticsearch+json; compatible-with=8",
57-
"Content-Type": "application/vnd.elasticsearch+json; compatible-with=8",
56+
"Accept": "application/vnd.elasticsearch+json; compatible-with=9",
57+
"Content-Type": "application/vnd.elasticsearch+json; compatible-with=9",
5858
}
5959

6060
# Search without body
6161
self.client.search(index="test2")
6262
assert len(calls) == 3
6363
assert calls[("POST", "/test2/_search")][0]["headers"] == {
64-
"Accept": "application/vnd.elasticsearch+json; compatible-with=8",
64+
"Accept": "application/vnd.elasticsearch+json; compatible-with=9",
6565
}
6666

6767
# Multiple mimetypes in Accept
6868
self.client.cat.nodes()
6969
assert len(calls) == 4
7070
assert calls[("GET", "/_cat/nodes")][0]["headers"] == {
7171
# text/plain isn't modified.
72-
"Accept": "text/plain,application/vnd.elasticsearch+json; compatible-with=8",
72+
"Accept": "text/plain,application/vnd.elasticsearch+json; compatible-with=9",
7373
}
7474

7575
# Bulk uses x-ndjson
7676
self.client.bulk(operations=[])
7777
assert len(calls) == 5
7878
assert calls[("PUT", "/_bulk")][0]["headers"] == {
79-
"Accept": "application/vnd.elasticsearch+json; compatible-with=8",
80-
"Content-Type": "application/vnd.elasticsearch+x-ndjson; compatible-with=8",
79+
"Accept": "application/vnd.elasticsearch+json; compatible-with=9",
80+
"Content-Type": "application/vnd.elasticsearch+x-ndjson; compatible-with=9",
8181
}
8282

8383
# Mapbox vector tiles
@@ -91,8 +91,8 @@ def test_compat_mode_on_by_default(self):
9191
)
9292
assert len(calls) == 6
9393
assert calls[("POST", "/test3/_mvt/field/z/x/y")][0]["headers"] == {
94-
"Accept": "application/vnd.elasticsearch+vnd.mapbox-vector-tile; compatible-with=8",
95-
"Content-Type": "application/vnd.elasticsearch+json; compatible-with=8",
94+
"Accept": "application/vnd.elasticsearch+vnd.mapbox-vector-tile; compatible-with=9",
95+
"Content-Type": "application/vnd.elasticsearch+json; compatible-with=9",
9696
}
9797

9898
@pytest.mark.parametrize("mime_subtype", ["json", "x-ndjson"])

test_elasticsearch/test_serializer.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,10 @@ def test_deserializes_text_with_correct_ct(self, data):
223223

224224
def test_deserialize_compatibility_header(self):
225225
for content_type in (
226-
"application/vnd.elasticsearch+json;compatible-with=7",
227-
"application/vnd.elasticsearch+json; compatible-with=7",
228226
"application/vnd.elasticsearch+json;compatible-with=8",
229227
"application/vnd.elasticsearch+json; compatible-with=8",
228+
"application/vnd.elasticsearch+json;compatible-with=9",
229+
"application/vnd.elasticsearch+json; compatible-with=9",
230230
):
231231
assert {"some": "data"} == self.serializers.loads(
232232
'{"some":"data"}', content_type
@@ -236,10 +236,10 @@ def test_deserialize_compatibility_header(self):
236236
)
237237

238238
for content_type in (
239-
"application/vnd.elasticsearch+x-ndjson;compatible-with=7",
240-
"application/vnd.elasticsearch+x-ndjson; compatible-with=7",
241239
"application/vnd.elasticsearch+x-ndjson;compatible-with=8",
242240
"application/vnd.elasticsearch+x-ndjson; compatible-with=8",
241+
"application/vnd.elasticsearch+x-ndjson;compatible-with=9",
242+
"application/vnd.elasticsearch+x-ndjson; compatible-with=9",
243243
):
244244
assert b'{"some":"data"}\n{"some":"data"}\n' == self.serializers.dumps(
245245
['{"some":"data"}', {"some": "data"}], content_type

0 commit comments

Comments
 (0)