Skip to content

Commit

Permalink
Updated bulk action in helpers (#239)
Browse files Browse the repository at this point in the history
Signed-off-by: saimedhi <saimedhi@amazon.com>

Signed-off-by: saimedhi <saimedhi@amazon.com>
  • Loading branch information
saimedhi authored Nov 23, 2022
1 parent 2672f3f commit dea10c8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
21 changes: 19 additions & 2 deletions opensearchpy/helpers/actions.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
# under the License.

import logging
import sys
from typing import (
Any,
AsyncIterable,
Expand All @@ -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

Expand Down Expand Up @@ -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],
Expand Down

0 comments on commit dea10c8

Please sign in to comment.