Skip to content

Commit 6be850b

Browse files
saimedhigithub-actions[bot]
authored andcommitted
Updated opensearch-py to reflect the latest OpenSearch API spec (2024-12-07)
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 7815c6a commit 6be850b

File tree

5 files changed

+25
-14
lines changed

5 files changed

+25
-14
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
66
- Added option to pass custom headers to 'AWSV4SignerAsyncAuth' ([863](https://github.com/opensearch-project/opensearch-py/pull/863))
77
- Added sync and async sample that uses `search_after` parameter ([859](https://github.com/opensearch-project/opensearch-py/pull/859))
88
### Updated APIs
9+
- Updated opensearch-py APIs to reflect [opensearch-api-specification@bbc0d9a](https://github.com/opensearch-project/opensearch-api-specification/commit/bbc0d9a2d0e19aaefe3ebefe9b0f994edb7f88ad)
910
### Changed
1011
- Small refactor of AWS Signer classes for both sync and async clients ([866](https://github.com/opensearch-project/opensearch-py/pull/866))
1112
### Deprecated

opensearchpy/_async/client/__init__.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ async def count(
667667
specified.
668668
:arg default_operator: The default operator for query string
669669
query: `AND` or `OR`. This parameter can only be used when the `q` query
670-
string parameter is specified. Valid choices are and, or.
670+
string parameter is specified. Valid choices are and, AND, or, OR.
671671
:arg df: Field to use as default where no field prefix is given
672672
in the query string. This parameter can only be used when the `q` query
673673
string parameter is specified.
@@ -855,7 +855,7 @@ async def delete_by_query(
855855
:arg conflicts: What to do if delete by query hits version
856856
conflicts: `abort` or `proceed`. Valid choices are abort, proceed.
857857
:arg default_operator: The default operator for query string
858-
query: `AND` or `OR`. Valid choices are and, or.
858+
query: `AND` or `OR`. Valid choices are and, AND, or, OR.
859859
:arg df: Field to use as default where no field prefix is given
860860
in the query string.
861861
:arg error_trace: Whether to include the stack trace of returned
@@ -1225,7 +1225,7 @@ async def explain(
12251225
parameter can only be used when the `q` query string parameter is
12261226
specified.
12271227
:arg default_operator: The default operator for query string
1228-
query: `AND` or `OR`. Valid choices are and, or.
1228+
query: `AND` or `OR`. Valid choices are and, AND, or, OR.
12291229
:arg df: Field to use as default where no field prefix is given
12301230
in the query string. Default is _all.
12311231
:arg error_trace: Whether to include the stack trace of returned
@@ -2281,7 +2281,7 @@ async def search(
22812281
executing cross-cluster search (CCS) requests. Default is True.
22822282
:arg default_operator: The default operator for query string
22832283
query: AND or OR. This parameter can only be used when the `q` query
2284-
string parameter is specified. Valid choices are and, or.
2284+
string parameter is specified. Valid choices are and, AND, or, OR.
22852285
:arg df: Field to use as default where no field prefix is given
22862286
in the query string. This parameter can only be used when the q query
22872287
string parameter is specified.
@@ -2834,7 +2834,7 @@ async def update_by_query(
28342834
:arg conflicts: What to do if update by query hits version
28352835
conflicts: `abort` or `proceed`. Valid choices are abort, proceed.
28362836
:arg default_operator: The default operator for query string
2837-
query: `AND` or `OR`. Valid choices are and, or.
2837+
query: `AND` or `OR`. Valid choices are and, AND, or, OR.
28382838
:arg df: Field to use as default where no field prefix is given
28392839
in the query string.
28402840
:arg error_trace: Whether to include the stack trace of returned

opensearchpy/_async/client/indices.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -1638,7 +1638,7 @@ async def validate_query(
16381638
parameter can only be used when the `q` query string parameter is
16391639
specified.
16401640
:arg default_operator: The default operator for query string
1641-
query: `AND` or `OR`. Valid choices are and, or.
1641+
query: `AND` or `OR`. Valid choices are and, AND, or, OR.
16421642
:arg df: Field to use as default where no field prefix is given
16431643
in the query string. This parameter can only be used when the `q` query
16441644
string parameter is specified.
@@ -1797,6 +1797,7 @@ async def recovery(
17971797
)
17981798
async def upgrade(
17991799
self,
1800+
body: Any = None,
18001801
index: Any = None,
18011802
params: Any = None,
18021803
headers: Any = None,
@@ -1832,7 +1833,11 @@ async def upgrade(
18321833
operation has completed before returning. Default is false.
18331834
"""
18341835
return await self.transport.perform_request(
1835-
"POST", _make_path(index, "_upgrade"), params=params, headers=headers
1836+
"POST",
1837+
_make_path(index, "_upgrade"),
1838+
params=params,
1839+
headers=headers,
1840+
body=body,
18361841
)
18371842

18381843
@query_params(

opensearchpy/client/__init__.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ def count(
667667
specified.
668668
:arg default_operator: The default operator for query string
669669
query: `AND` or `OR`. This parameter can only be used when the `q` query
670-
string parameter is specified. Valid choices are and, or.
670+
string parameter is specified. Valid choices are and, AND, or, OR.
671671
:arg df: Field to use as default where no field prefix is given
672672
in the query string. This parameter can only be used when the `q` query
673673
string parameter is specified.
@@ -855,7 +855,7 @@ def delete_by_query(
855855
:arg conflicts: What to do if delete by query hits version
856856
conflicts: `abort` or `proceed`. Valid choices are abort, proceed.
857857
:arg default_operator: The default operator for query string
858-
query: `AND` or `OR`. Valid choices are and, or.
858+
query: `AND` or `OR`. Valid choices are and, AND, or, OR.
859859
:arg df: Field to use as default where no field prefix is given
860860
in the query string.
861861
:arg error_trace: Whether to include the stack trace of returned
@@ -1225,7 +1225,7 @@ def explain(
12251225
parameter can only be used when the `q` query string parameter is
12261226
specified.
12271227
:arg default_operator: The default operator for query string
1228-
query: `AND` or `OR`. Valid choices are and, or.
1228+
query: `AND` or `OR`. Valid choices are and, AND, or, OR.
12291229
:arg df: Field to use as default where no field prefix is given
12301230
in the query string. Default is _all.
12311231
:arg error_trace: Whether to include the stack trace of returned
@@ -2281,7 +2281,7 @@ def search(
22812281
executing cross-cluster search (CCS) requests. Default is True.
22822282
:arg default_operator: The default operator for query string
22832283
query: AND or OR. This parameter can only be used when the `q` query
2284-
string parameter is specified. Valid choices are and, or.
2284+
string parameter is specified. Valid choices are and, AND, or, OR.
22852285
:arg df: Field to use as default where no field prefix is given
22862286
in the query string. This parameter can only be used when the q query
22872287
string parameter is specified.
@@ -2834,7 +2834,7 @@ def update_by_query(
28342834
:arg conflicts: What to do if update by query hits version
28352835
conflicts: `abort` or `proceed`. Valid choices are abort, proceed.
28362836
:arg default_operator: The default operator for query string
2837-
query: `AND` or `OR`. Valid choices are and, or.
2837+
query: `AND` or `OR`. Valid choices are and, AND, or, OR.
28382838
:arg df: Field to use as default where no field prefix is given
28392839
in the query string.
28402840
:arg error_trace: Whether to include the stack trace of returned

opensearchpy/client/indices.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -1638,7 +1638,7 @@ def validate_query(
16381638
parameter can only be used when the `q` query string parameter is
16391639
specified.
16401640
:arg default_operator: The default operator for query string
1641-
query: `AND` or `OR`. Valid choices are and, or.
1641+
query: `AND` or `OR`. Valid choices are and, AND, or, OR.
16421642
:arg df: Field to use as default where no field prefix is given
16431643
in the query string. This parameter can only be used when the `q` query
16441644
string parameter is specified.
@@ -1797,6 +1797,7 @@ def recovery(
17971797
)
17981798
def upgrade(
17991799
self,
1800+
body: Any = None,
18001801
index: Any = None,
18011802
params: Any = None,
18021803
headers: Any = None,
@@ -1832,7 +1833,11 @@ def upgrade(
18321833
operation has completed before returning. Default is false.
18331834
"""
18341835
return self.transport.perform_request(
1835-
"POST", _make_path(index, "_upgrade"), params=params, headers=headers
1836+
"POST",
1837+
_make_path(index, "_upgrade"),
1838+
params=params,
1839+
headers=headers,
1840+
body=body,
18361841
)
18371842

18381843
@query_params(

0 commit comments

Comments
 (0)