File tree 2 files changed +2
-27
lines changed
elasticsearch/_sync/client
test_elasticsearch/test_client 2 files changed +2
-27
lines changed Original file line number Diff line number Diff line change @@ -379,15 +379,6 @@ def wrapped(*args: Any, **kwargs: Any) -> Any:
379
379
f"'{ body_name } ' parameter. See https://github.com/elastic/elasticsearch-py/"
380
380
"issues/1698 for more information"
381
381
)
382
-
383
- warnings .warn (
384
- "The 'body' parameter is deprecated and will be removed "
385
- f"in a future version. Instead use the '{ body_name } ' parameter. "
386
- "See https://github.com/elastic/elasticsearch-py/issues/1698 "
387
- "for more information" ,
388
- category = DeprecationWarning ,
389
- stacklevel = warn_stacklevel (),
390
- )
391
382
kwargs [body_name ] = body
392
383
393
384
elif body_fields :
@@ -396,12 +387,6 @@ def wrapped(*args: Any, **kwargs: Any) -> Any:
396
387
"Couldn't merge 'body' with other parameters as it wasn't a mapping. "
397
388
"Instead of using 'body' use individual API parameters"
398
389
)
399
- warnings .warn (
400
- "The 'body' parameter is deprecated and will be removed "
401
- "in a future version. Instead use individual parameters." ,
402
- category = DeprecationWarning ,
403
- stacklevel = warn_stacklevel (),
404
- )
405
390
_merge_kwargs_no_duplicates (kwargs , body )
406
391
407
392
if parameter_aliases :
Original file line number Diff line number Diff line change @@ -87,18 +87,12 @@ def test_body_name_using_body(self):
87
87
api_key = ("id" , "api_key" ), body = {"query" : {"match_all" : {}}}
88
88
)
89
89
90
- assert len (w ) == 2
90
+ assert len (w ) == 1
91
91
assert w [0 ].category == DeprecationWarning
92
92
assert (
93
93
str (w [0 ].message )
94
94
== "Passing transport options in the API method is deprecated. Use 'Elasticsearch.options()' instead."
95
95
)
96
- assert w [1 ].category == DeprecationWarning
97
- assert str (w [1 ].message ) == (
98
- "The 'body' parameter is deprecated and will be removed in a "
99
- "future version. Instead use the 'document' parameter. See https://github.com/elastic/elasticsearch-py/issues/1698 "
100
- "for more information"
101
- )
102
96
103
97
assert self .calls == [
104
98
((), {"api_key" : ("id" , "api_key" )}),
@@ -139,16 +133,12 @@ def test_body_fields(self):
139
133
api_key = ("id" , "api_key" ), body = {"query" : {"match_all" : {}}}
140
134
)
141
135
142
- assert len (w ) == 2
136
+ assert len (w ) == 1
143
137
assert w [0 ].category == DeprecationWarning
144
138
assert (
145
139
str (w [0 ].message )
146
140
== "Passing transport options in the API method is deprecated. Use 'Elasticsearch.options()' instead."
147
141
)
148
- assert w [1 ].category == DeprecationWarning
149
- assert str (w [1 ].message ) == (
150
- "The 'body' parameter is deprecated and will be removed in a future version. Instead use individual parameters."
151
- )
152
142
153
143
assert self .calls == [
154
144
((), {"api_key" : ("id" , "api_key" )}),
You can’t perform that action at this time.
0 commit comments