From 5536fef8814e096d2d08a734bc03c419ef771b37 Mon Sep 17 00:00:00 2001 From: saimedhi Date: Tue, 14 Feb 2023 00:00:17 -0800 Subject: [PATCH] Removed 'out/opensearchpy' folder which was produced while generating pyi files for plugins Signed-off-by: saimedhi --- CHANGELOG.md | 1 + opensearchpy/_async/helpers.py | 4 - opensearchpy/_async/transport.py | 1 - opensearchpy/connection/http_async.py | 1 - opensearchpy/helpers/actions.py | 4 - opensearchpy/transport.py | 3 +- out/opensearchpy/client/plugins.pyi | 16 ---- out/opensearchpy/plugins/__init__.pyi | 8 -- out/opensearchpy/plugins/alerting.pyi | 73 ------------------- .../test_async/test_server/test_helpers.py | 2 - 10 files changed, 3 insertions(+), 110 deletions(-) delete mode 100644 out/opensearchpy/client/plugins.pyi delete mode 100644 out/opensearchpy/plugins/__init__.pyi delete mode 100644 out/opensearchpy/plugins/alerting.pyi diff --git a/CHANGELOG.md b/CHANGELOG.md index 157f89aa..5d59366e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ### Removed - Removed patch versions in integration tests for OpenSearch 1.0.0 - 2.3.0 to reduce Github Action jobs ([#262](https://github.com/opensearch-project/opensearch-py/pull/262)) +- Removed 'out/opensearchpy' folder which was produced while generating pyi files for plugins ([#288](https://github.com/opensearch-project/opensearch-py/pull/288)) ### Fixed - Fixed DeprecationWarning emitted from urllib3 1.26.13+ ([#246](https://github.com/opensearch-project/opensearch-py/pull/246)) ### Security diff --git a/opensearchpy/_async/helpers.py b/opensearchpy/_async/helpers.py index cb0c43ef..78ae7301 100644 --- a/opensearchpy/_async/helpers.py +++ b/opensearchpy/_async/helpers.py @@ -143,7 +143,6 @@ async def async_streaming_bulk( *args, **kwargs ): - """ Streaming bulk consumes actions from the iterable passed in and yields results per action. For non-streaming usecases use @@ -185,7 +184,6 @@ async def map_actions(): async for bulk_data, bulk_actions in _chunk_actions( map_actions(), chunk_size, max_chunk_bytes, client.transport.serializer ): - for attempt in range(max_retries + 1): to_retry, to_retry_data = [], [] if attempt: @@ -207,7 +205,6 @@ async def map_actions(): **kwargs, ), ): - if not ok: action, info = info.popitem() # retry if retries enabled, we get 429, and we are not @@ -422,7 +419,6 @@ async def async_reindex( scan_kwargs={}, bulk_kwargs={}, ): - """ Reindex all documents from one index that satisfy a given query to another, potentially (if `target_client` is specified) on a different cluster. diff --git a/opensearchpy/_async/transport.py b/opensearchpy/_async/transport.py index 65b2bdec..e93344bc 100644 --- a/opensearchpy/_async/transport.py +++ b/opensearchpy/_async/transport.py @@ -160,7 +160,6 @@ async def _async_init(self): # ... and we can start sniffing in the background. if self.sniffing_task is None and self.sniff_on_start: - # Create an asyncio.Event for future calls to block on # until the initial sniffing task completes. self._sniff_on_start_event = asyncio.Event() diff --git a/opensearchpy/connection/http_async.py b/opensearchpy/connection/http_async.py index 8c2c94d2..983fd7b1 100644 --- a/opensearchpy/connection/http_async.py +++ b/opensearchpy/connection/http_async.py @@ -196,7 +196,6 @@ async def perform_request( start = self.loop.time() try: - async with self.session.request( method, url, diff --git a/opensearchpy/helpers/actions.py b/opensearchpy/helpers/actions.py index 9f2ddfd2..e565256f 100644 --- a/opensearchpy/helpers/actions.py +++ b/opensearchpy/helpers/actions.py @@ -280,7 +280,6 @@ def streaming_bulk( *args, **kwargs ): - """ Streaming bulk consumes actions from the iterable passed in and yields results per action. For non-streaming usecases use @@ -319,7 +318,6 @@ def streaming_bulk( for bulk_data, bulk_actions in _chunk_actions( actions, chunk_size, max_chunk_bytes, client.transport.serializer ): - for attempt in range(max_retries + 1): to_retry, to_retry_data = [], [] if attempt: @@ -339,7 +337,6 @@ def streaming_bulk( **kwargs ), ): - if not ok: action, info = info.popitem() # retry if retries enabled, we get 429, and we are not @@ -621,7 +618,6 @@ def reindex( scan_kwargs={}, bulk_kwargs={}, ): - """ Reindex all documents from one index that satisfy a given query to another, potentially (if `target_client` is specified) on a different cluster. diff --git a/opensearchpy/transport.py b/opensearchpy/transport.py index 78c559d8..c1d69d2c 100644 --- a/opensearchpy/transport.py +++ b/opensearchpy/transport.py @@ -197,13 +197,14 @@ def set_connections(self, hosts): :arg hosts: same as `__init__` """ + # construct the connections def _create_connection(host): # if this is not the initial setup look at the existing connection # options and identify connections that haven't changed and can be # kept around. if hasattr(self, "connection_pool"): - for (connection, old_host) in self.connection_pool.connection_opts: + for connection, old_host in self.connection_pool.connection_opts: if old_host == host: return connection diff --git a/out/opensearchpy/client/plugins.pyi b/out/opensearchpy/client/plugins.pyi deleted file mode 100644 index 255e1efd..00000000 --- a/out/opensearchpy/client/plugins.pyi +++ /dev/null @@ -1,16 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 -# -# The OpenSearch Contributors require contributions made to -# this file be licensed under the Apache-2.0 license or a -# compatible open source license. -# -# Modifications Copyright OpenSearch Contributors. See -# GitHub history for details. - -from ..plugins.alerting import AlertingClient as AlertingClient -from .utils import NamespacedClient as NamespacedClient -from typing import Any - -class PluginsClient(NamespacedClient): - alerting: Any - def __init__(self, client) -> None: ... diff --git a/out/opensearchpy/plugins/__init__.pyi b/out/opensearchpy/plugins/__init__.pyi deleted file mode 100644 index 6c0097cd..00000000 --- a/out/opensearchpy/plugins/__init__.pyi +++ /dev/null @@ -1,8 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 -# -# The OpenSearch Contributors require contributions made to -# this file be licensed under the Apache-2.0 license or a -# compatible open source license. -# -# Modifications Copyright OpenSearch Contributors. See -# GitHub history for details. diff --git a/out/opensearchpy/plugins/alerting.pyi b/out/opensearchpy/plugins/alerting.pyi deleted file mode 100644 index 9cac32fb..00000000 --- a/out/opensearchpy/plugins/alerting.pyi +++ /dev/null @@ -1,73 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 -# -# The OpenSearch Contributors require contributions made to -# this file be licensed under the Apache-2.0 license or a -# compatible open source license. -# -# Modifications Copyright OpenSearch Contributors. See -# GitHub history for details. - -from ..client.utils import ( - NamespacedClient as NamespacedClient, - query_params as query_params, -) -from typing import Any, Union - -class AlertingClient(NamespacedClient): - def search_monitor( - self, body, params: Any | None = ..., headers: Any | None = ... - ) -> Union[bool, Any]: ... - def get_monitor( - self, monitor_id, params: Any | None = ..., headers: Any | None = ... - ) -> Union[bool, Any]: ... - def run_monitor( - self, monitor_id, params: Any | None = ..., headers: Any | None = ... - ) -> Union[bool, Any]: ... - def create_monitor( - self, - body: Any | None = ..., - params: Any | None = ..., - headers: Any | None = ..., - ) -> Union[bool, Any]: ... - def update_monitor( - self, - monitor_id, - body: Any | None = ..., - params: Any | None = ..., - headers: Any | None = ..., - ) -> Union[bool, Any]: ... - def delete_monitor( - self, monitor_id, params: Any | None = ..., headers: Any | None = ... - ) -> Union[bool, Any]: ... - def get_destination( - self, - destination_id: Any | None = ..., - params: Any | None = ..., - headers: Any | None = ..., - ) -> Union[bool, Any]: ... - def create_destination( - self, - body: Any | None = ..., - params: Any | None = ..., - headers: Any | None = ..., - ) -> Union[bool, Any]: ... - def update_destination( - self, - destination_id, - body: Any | None = ..., - params: Any | None = ..., - headers: Any | None = ..., - ) -> Union[bool, Any]: ... - def delete_destination( - self, destination_id, params: Any | None = ..., headers: Any | None = ... - ) -> Union[bool, Any]: ... - def get_alerts( - self, params: Any | None = ..., headers: Any | None = ... - ) -> Union[bool, Any]: ... - def acknowledge_alert( - self, - monitor_id, - body: Any | None = ..., - params: Any | None = ..., - headers: Any | None = ..., - ) -> Union[bool, Any]: ... diff --git a/test_opensearchpy/test_async/test_server/test_helpers.py b/test_opensearchpy/test_async/test_server/test_helpers.py index 387d0a96..e6571973 100644 --- a/test_opensearchpy/test_async/test_server/test_helpers.py +++ b/test_opensearchpy/test_async/test_server/test_helpers.py @@ -530,7 +530,6 @@ async def test_initial_search_error(self, async_client, scan_teardown): ), ): with patch.object(async_client, "scroll", MockScroll()): - data = [ x async for x in helpers.async_scan( @@ -554,7 +553,6 @@ async def test_initial_search_error(self, async_client, scan_teardown): ), ): with patch.object(async_client, "scroll", MockScroll()) as mock_scroll: - with pytest.raises(ScanError): data = [ x