From 6be850bdf56ff3e5aa79d33ebe9bd2802a4bd6ce Mon Sep 17 00:00:00 2001 From: saimedhi <117196660+saimedhi@users.noreply.github.com> Date: Sat, 7 Dec 2024 03:42:11 +0000 Subject: [PATCH] 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> --- CHANGELOG.md | 1 + opensearchpy/_async/client/__init__.py | 10 +++++----- opensearchpy/_async/client/indices.py | 9 +++++++-- opensearchpy/client/__init__.py | 10 +++++----- opensearchpy/client/indices.py | 9 +++++++-- 5 files changed, 25 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3354d4e1..0d416704 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Added option to pass custom headers to 'AWSV4SignerAsyncAuth' ([863](https://github.com/opensearch-project/opensearch-py/pull/863)) - Added sync and async sample that uses `search_after` parameter ([859](https://github.com/opensearch-project/opensearch-py/pull/859)) ### Updated APIs +- Updated opensearch-py APIs to reflect [opensearch-api-specification@bbc0d9a](https://github.com/opensearch-project/opensearch-api-specification/commit/bbc0d9a2d0e19aaefe3ebefe9b0f994edb7f88ad) ### Changed - Small refactor of AWS Signer classes for both sync and async clients ([866](https://github.com/opensearch-project/opensearch-py/pull/866)) ### Deprecated diff --git a/opensearchpy/_async/client/__init__.py b/opensearchpy/_async/client/__init__.py index 5c1fa04f..c8e1e2e4 100644 --- a/opensearchpy/_async/client/__init__.py +++ b/opensearchpy/_async/client/__init__.py @@ -667,7 +667,7 @@ async def count( specified. :arg default_operator: The default operator for query string query: `AND` or `OR`. This parameter can only be used when the `q` query - string parameter is specified. Valid choices are and, or. + string parameter is specified. Valid choices are and, AND, or, OR. :arg df: Field to use as default where no field prefix is given in the query string. This parameter can only be used when the `q` query string parameter is specified. @@ -855,7 +855,7 @@ async def delete_by_query( :arg conflicts: What to do if delete by query hits version conflicts: `abort` or `proceed`. Valid choices are abort, proceed. :arg default_operator: The default operator for query string - query: `AND` or `OR`. Valid choices are and, or. + query: `AND` or `OR`. Valid choices are and, AND, or, OR. :arg df: Field to use as default where no field prefix is given in the query string. :arg error_trace: Whether to include the stack trace of returned @@ -1225,7 +1225,7 @@ async def explain( parameter can only be used when the `q` query string parameter is specified. :arg default_operator: The default operator for query string - query: `AND` or `OR`. Valid choices are and, or. + query: `AND` or `OR`. Valid choices are and, AND, or, OR. :arg df: Field to use as default where no field prefix is given in the query string. Default is _all. :arg error_trace: Whether to include the stack trace of returned @@ -2281,7 +2281,7 @@ async def search( executing cross-cluster search (CCS) requests. Default is True. :arg default_operator: The default operator for query string query: AND or OR. This parameter can only be used when the `q` query - string parameter is specified. Valid choices are and, or. + string parameter is specified. Valid choices are and, AND, or, OR. :arg df: Field to use as default where no field prefix is given in the query string. This parameter can only be used when the q query string parameter is specified. @@ -2834,7 +2834,7 @@ async def update_by_query( :arg conflicts: What to do if update by query hits version conflicts: `abort` or `proceed`. Valid choices are abort, proceed. :arg default_operator: The default operator for query string - query: `AND` or `OR`. Valid choices are and, or. + query: `AND` or `OR`. Valid choices are and, AND, or, OR. :arg df: Field to use as default where no field prefix is given in the query string. :arg error_trace: Whether to include the stack trace of returned diff --git a/opensearchpy/_async/client/indices.py b/opensearchpy/_async/client/indices.py index 99603830..2a10af57 100644 --- a/opensearchpy/_async/client/indices.py +++ b/opensearchpy/_async/client/indices.py @@ -1638,7 +1638,7 @@ async def validate_query( parameter can only be used when the `q` query string parameter is specified. :arg default_operator: The default operator for query string - query: `AND` or `OR`. Valid choices are and, or. + query: `AND` or `OR`. Valid choices are and, AND, or, OR. :arg df: Field to use as default where no field prefix is given in the query string. This parameter can only be used when the `q` query string parameter is specified. @@ -1797,6 +1797,7 @@ async def recovery( ) async def upgrade( self, + body: Any = None, index: Any = None, params: Any = None, headers: Any = None, @@ -1832,7 +1833,11 @@ async def upgrade( operation has completed before returning. Default is false. """ return await self.transport.perform_request( - "POST", _make_path(index, "_upgrade"), params=params, headers=headers + "POST", + _make_path(index, "_upgrade"), + params=params, + headers=headers, + body=body, ) @query_params( diff --git a/opensearchpy/client/__init__.py b/opensearchpy/client/__init__.py index 118cfa7a..48fca34b 100644 --- a/opensearchpy/client/__init__.py +++ b/opensearchpy/client/__init__.py @@ -667,7 +667,7 @@ def count( specified. :arg default_operator: The default operator for query string query: `AND` or `OR`. This parameter can only be used when the `q` query - string parameter is specified. Valid choices are and, or. + string parameter is specified. Valid choices are and, AND, or, OR. :arg df: Field to use as default where no field prefix is given in the query string. This parameter can only be used when the `q` query string parameter is specified. @@ -855,7 +855,7 @@ def delete_by_query( :arg conflicts: What to do if delete by query hits version conflicts: `abort` or `proceed`. Valid choices are abort, proceed. :arg default_operator: The default operator for query string - query: `AND` or `OR`. Valid choices are and, or. + query: `AND` or `OR`. Valid choices are and, AND, or, OR. :arg df: Field to use as default where no field prefix is given in the query string. :arg error_trace: Whether to include the stack trace of returned @@ -1225,7 +1225,7 @@ def explain( parameter can only be used when the `q` query string parameter is specified. :arg default_operator: The default operator for query string - query: `AND` or `OR`. Valid choices are and, or. + query: `AND` or `OR`. Valid choices are and, AND, or, OR. :arg df: Field to use as default where no field prefix is given in the query string. Default is _all. :arg error_trace: Whether to include the stack trace of returned @@ -2281,7 +2281,7 @@ def search( executing cross-cluster search (CCS) requests. Default is True. :arg default_operator: The default operator for query string query: AND or OR. This parameter can only be used when the `q` query - string parameter is specified. Valid choices are and, or. + string parameter is specified. Valid choices are and, AND, or, OR. :arg df: Field to use as default where no field prefix is given in the query string. This parameter can only be used when the q query string parameter is specified. @@ -2834,7 +2834,7 @@ def update_by_query( :arg conflicts: What to do if update by query hits version conflicts: `abort` or `proceed`. Valid choices are abort, proceed. :arg default_operator: The default operator for query string - query: `AND` or `OR`. Valid choices are and, or. + query: `AND` or `OR`. Valid choices are and, AND, or, OR. :arg df: Field to use as default where no field prefix is given in the query string. :arg error_trace: Whether to include the stack trace of returned diff --git a/opensearchpy/client/indices.py b/opensearchpy/client/indices.py index c4b2405c..61523e1b 100644 --- a/opensearchpy/client/indices.py +++ b/opensearchpy/client/indices.py @@ -1638,7 +1638,7 @@ def validate_query( parameter can only be used when the `q` query string parameter is specified. :arg default_operator: The default operator for query string - query: `AND` or `OR`. Valid choices are and, or. + query: `AND` or `OR`. Valid choices are and, AND, or, OR. :arg df: Field to use as default where no field prefix is given in the query string. This parameter can only be used when the `q` query string parameter is specified. @@ -1797,6 +1797,7 @@ def recovery( ) def upgrade( self, + body: Any = None, index: Any = None, params: Any = None, headers: Any = None, @@ -1832,7 +1833,11 @@ def upgrade( operation has completed before returning. Default is false. """ return self.transport.perform_request( - "POST", _make_path(index, "_upgrade"), params=params, headers=headers + "POST", + _make_path(index, "_upgrade"), + params=params, + headers=headers, + body=body, ) @query_params(