Updated bulk action in helpers (#239)
Signed-off-by: saimedhi <[email protected]> Signed-off-by: saimedhi <[email protected]>
This commit is contained in:
@@ -5,6 +5,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
|||||||
### Added
|
### Added
|
||||||
- Added Point in time API rest API([#191](https://github.com/opensearch-project/opensearch-py/pull/191))
|
- 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))
|
- 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
|
### Changed
|
||||||
- Updated getting started to user guide ([#233](https://github.com/opensearch-project/opensearch-py/pull/233))
|
- 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))
|
- 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.
|
# under the License.
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
import sys
|
||||||
from typing import (
|
from typing import (
|
||||||
Any,
|
Any,
|
||||||
AsyncIterable,
|
AsyncIterable,
|
||||||
@@ -38,8 +39,14 @@ from typing import (
|
|||||||
Optional,
|
Optional,
|
||||||
Tuple,
|
Tuple,
|
||||||
Union,
|
Union,
|
||||||
|
overload,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if sys.version_info >= (3, 8):
|
||||||
|
from typing import Literal
|
||||||
|
else:
|
||||||
|
from typing_extensions import Literal
|
||||||
|
|
||||||
from ..client import OpenSearch
|
from ..client import OpenSearch
|
||||||
from ..serializer import Serializer
|
from ..serializer import Serializer
|
||||||
|
|
||||||
@@ -74,14 +81,24 @@ def streaming_bulk(
|
|||||||
*args: Any,
|
*args: Any,
|
||||||
**kwargs: Any
|
**kwargs: Any
|
||||||
) -> Generator[Tuple[bool, Any], None, None]: ...
|
) -> Generator[Tuple[bool, Any], None, None]: ...
|
||||||
|
@overload
|
||||||
def bulk(
|
def bulk(
|
||||||
client: OpenSearch,
|
client: OpenSearch,
|
||||||
actions: Iterable[Any],
|
actions: Iterable[Any],
|
||||||
stats_only: bool = ...,
|
stats_only: Literal[True] = ...,
|
||||||
ignore_status: Optional[Union[int, Collection[int]]] = ...,
|
ignore_status: Optional[Union[int, Collection[int]]] = ...,
|
||||||
*args: Any,
|
*args: Any,
|
||||||
**kwargs: 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(
|
def parallel_bulk(
|
||||||
client: OpenSearch,
|
client: OpenSearch,
|
||||||
actions: Iterable[Any],
|
actions: Iterable[Any],
|
||||||
|
|||||||
Reference in New Issue
Block a user