Skip to content

Commit

Permalink
Auto-generated API code
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Feb 6, 2023
1 parent 25d4c65 commit 8150a6d
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 18 deletions.
1 change: 0 additions & 1 deletion elasticsearch/_async/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ def __init__(
sniff_callback = default_sniff_callback

if _transport is None:

requests_session_auth = None
if http_auth is not None and http_auth is not DEFAULT:
if is_requests_http_auth(http_auth):
Expand Down
1 change: 0 additions & 1 deletion elasticsearch/_async/client/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ def resolve_auth_headers(
basic_auth: Union[DefaultType, None, Tuple[str, str], str] = DEFAULT,
bearer_auth: Union[DefaultType, None, str] = DEFAULT,
) -> HttpHeaders:

if headers is None:
headers = HttpHeaders()
elif not isinstance(headers, HttpHeaders):
Expand Down
4 changes: 0 additions & 4 deletions elasticsearch/_async/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ async def async_streaming_bulk(
*args: Any,
**kwargs: Any,
) -> AsyncIterable[Tuple[bool, Dict[str, Any]]]:

"""
Streaming bulk consumes actions from the iterable passed in and yields
results per action. For non-streaming usecases use
Expand Down Expand Up @@ -230,7 +229,6 @@ async def map_actions() -> AsyncIterable[_TYPE_BULK_ACTION_HEADER_AND_BODY]:
async for bulk_data, bulk_actions in _chunk_actions(
map_actions(), chunk_size, max_chunk_bytes, serializer
):

for attempt in range(max_retries + 1):
to_retry: List[bytes] = []
to_retry_data: List[
Expand Down Expand Up @@ -264,7 +262,6 @@ async def map_actions() -> AsyncIterable[_TYPE_BULK_ACTION_HEADER_AND_BODY]:
**kwargs,
),
):

if not ok:
action, info = info.popitem()
# retry if retries enabled, we get 429, and we are not
Expand Down Expand Up @@ -509,7 +506,6 @@ async def async_reindex(
scan_kwargs: MutableMapping[str, Any] = {},
bulk_kwargs: MutableMapping[str, Any] = {},
) -> Tuple[int, Union[int, List[Any]]]:

"""
Reindex all documents from one index that satisfy a given query
to another, potentially (if `target_client` is specified) on a different cluster.
Expand Down
1 change: 0 additions & 1 deletion elasticsearch/_sync/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ def __init__(
sniff_callback = default_sniff_callback

if _transport is None:

requests_session_auth = None
if http_auth is not None and http_auth is not DEFAULT:
if is_requests_http_auth(http_auth):
Expand Down
1 change: 0 additions & 1 deletion elasticsearch/_sync/client/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ def resolve_auth_headers(
basic_auth: Union[DefaultType, None, Tuple[str, str], str] = DEFAULT,
bearer_auth: Union[DefaultType, None, str] = DEFAULT,
) -> HttpHeaders:

if headers is None:
headers = HttpHeaders()
elif not isinstance(headers, HttpHeaders):
Expand Down
4 changes: 0 additions & 4 deletions elasticsearch/helpers/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,6 @@ def streaming_bulk(
*args: Any,
**kwargs: Any,
) -> Iterable[Tuple[bool, Dict[str, Any]]]:

"""
Streaming bulk consumes actions from the iterable passed in and yields
results per action. For non-streaming usecases use
Expand Down Expand Up @@ -422,7 +421,6 @@ def streaming_bulk(
for bulk_data, bulk_actions in _chunk_actions(
map(expand_action_callback, actions), chunk_size, max_chunk_bytes, serializer
):

for attempt in range(max_retries + 1):
to_retry: List[bytes] = []
to_retry_data: List[
Expand All @@ -448,7 +446,6 @@ def streaming_bulk(
**kwargs,
),
):

if not ok:
action, info = info.popitem()
# retry if retries enabled, we get 429, and we are not
Expand Down Expand Up @@ -770,7 +767,6 @@ def reindex(
scan_kwargs: MutableMapping[str, Any] = {},
bulk_kwargs: MutableMapping[str, Any] = {},
) -> Tuple[int, Union[int, List[Dict[str, Any]]]]:

"""
Reindex all documents from one index that satisfy a given query
to another, potentially (if `target_client` is specified) on a different cluster.
Expand Down
2 changes: 0 additions & 2 deletions test_elasticsearch/test_async/test_server/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,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(
Expand All @@ -586,7 +585,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
Expand Down
4 changes: 0 additions & 4 deletions test_elasticsearch/test_server/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,6 @@ def test_initial_search_error(sync_client):
with patch.object(sync_client, "scroll") as scroll_mock, patch.object(
sync_client, "clear_scroll"
) as clear_scroll_mock:

scroll_mock.side_effect = mock_scroll_responses
data = list(
helpers.scan(
Expand All @@ -549,7 +548,6 @@ def test_initial_search_error(sync_client):
with patch.object(sync_client, "scroll") as scroll_mock, patch.object(
sync_client, "clear_scroll"
) as clear_scroll_mock:

scroll_mock.side_effect = mock_scroll_responses
with pytest.raises(ScanError):
data = list(
Expand Down Expand Up @@ -644,7 +642,6 @@ def test_scan_auth_kwargs_forwarded(sync_client, kwargs):


def test_scan_auth_kwargs_favor_scroll_kwargs_option(sync_client):

with patch.object(
sync_client, "options", return_value=sync_client
) as options_mock, patch.object(
Expand Down Expand Up @@ -672,7 +669,6 @@ def test_scan_auth_kwargs_favor_scroll_kwargs_option(sync_client):
) as scroll_mock, patch.object(
sync_client, "clear_scroll", return_value=ObjectApiResponse(raw={}, meta=None)
):

data = list(
helpers.scan(
sync_client,
Expand Down

0 comments on commit 8150a6d

Please sign in to comment.