Updated bulk action in helpers (#239)
Signed-off-by: saimedhi <saimedhi@amazon.com> Signed-off-by: saimedhi <saimedhi@amazon.com>
This commit is contained in:
@@ -5,6 +5,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
||||
### Added
|
||||
- Added Point in time API rest API([#191](https://github.com/opensearch-project/opensearch-py/pull/191))
|
||||
- Github workflow for changelog verification ([#218](https://github.com/opensearch-project/opensearch-py/pull/218))
|
||||
- Added overload decorators to helpers-actions.pyi-"bulk" ([#239](https://github.com/opensearch-project/opensearch-py/pull/239))
|
||||
### Changed
|
||||
- Updated getting started to user guide ([#233](https://github.com/opensearch-project/opensearch-py/pull/233))
|
||||
- Updated CA certificate handling to check OpenSSL environment variables before defaulting to certifi ([#196](https://github.com/opensearch-project/opensearch-py/pull/196))
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
# under the License.
|
||||
|
||||
import logging
|
||||
import sys
|
||||
from typing import (
|
||||
Any,
|
||||
AsyncIterable,
|
||||
@@ -38,8 +39,14 @@ from typing import (
|
||||
Optional,
|
||||
Tuple,
|
||||
Union,
|
||||
overload,
|
||||
)
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
from typing import Literal
|
||||
else:
|
||||
from typing_extensions import Literal
|
||||
|
||||
from ..client import OpenSearch
|
||||
from ..serializer import Serializer
|
||||
|
||||
@@ -74,14 +81,24 @@ def streaming_bulk(
|
||||
*args: Any,
|
||||
**kwargs: Any
|
||||
) -> Generator[Tuple[bool, Any], None, None]: ...
|
||||
@overload
|
||||
def bulk(
|
||||
client: OpenSearch,
|
||||
actions: Iterable[Any],
|
||||
stats_only: bool = ...,
|
||||
stats_only: Literal[True] = ...,
|
||||
ignore_status: Optional[Union[int, Collection[int]]] = ...,
|
||||
*args: Any,
|
||||
**kwargs: Any
|
||||
) -> Tuple[int, Union[int, List[Any]]]: ...
|
||||
) -> Tuple[int, int]: ...
|
||||
@overload
|
||||
def bulk(
|
||||
client: OpenSearch,
|
||||
actions: Iterable[Any],
|
||||
stats_only: Literal[False],
|
||||
ignore_status: Optional[Union[int, Collection[int]]] = ...,
|
||||
*args: Any,
|
||||
**kwargs: Any
|
||||
) -> Tuple[int, List[Any]]: ...
|
||||
def parallel_bulk(
|
||||
client: OpenSearch,
|
||||
actions: Iterable[Any],
|
||||
|
||||
Reference in New Issue
Block a user