Skip to content

Commit 9299e0e

Browse files
committed
Fix lint
1 parent e6c68bb commit 9299e0e

File tree

6 files changed

+11
-9
lines changed

6 files changed

+11
-9
lines changed

elasticsearch/_async/client/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ def options(
451451
new_headers.update(resolved_headers)
452452
client._base_client._headers = new_headers
453453
else:
454-
client._base_client._headers = self._headers.copy()
454+
client._base_client._headers = self._base_client._headers.copy()
455455

456456
if request_timeout is not DEFAULT:
457457
client._base_client._request_timeout = request_timeout

elasticsearch/_async/client/_base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ def __init__(self, _transport: AsyncTransport, headers: HttpHeaders) -> None:
218218
self._ignore_status: Union[DefaultType, Collection[int]] = DEFAULT
219219
self._max_retries: Union[DefaultType, int] = DEFAULT
220220
self._retry_on_status: Union[DefaultType, Collection[int]] = DEFAULT
221+
self._retry_on_timeout: Union[DefaultType, bool] = DEFAULT
221222
self._verified_elasticsearch = False
222223
self._otel = OpenTelemetry()
223224

elasticsearch/_async/helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ async def async_streaming_bulk(
216216
"""
217217

218218
client = client.options()
219-
client._client_meta = (("h", "bp"),)
219+
client._base_client._client_meta = (("h", "bp"),)
220220

221221
if isinstance(retry_on_status, int):
222222
retry_on_status = (retry_on_status,)
@@ -429,7 +429,7 @@ def pop_transport_kwargs(kw: MutableMapping[str, Any]) -> MutableMapping[str, An
429429
client = client.options(
430430
request_timeout=request_timeout, **pop_transport_kwargs(kwargs)
431431
)
432-
client._client_meta = (("h", "s"),)
432+
client._base_client._client_meta = (("h", "s"),)
433433

434434
# Setting query={"from": ...} would make 'from' be used
435435
# as a keyword argument instead of 'from_'. We handle that here.

elasticsearch/_sync/client/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ def options(
451451
new_headers.update(resolved_headers)
452452
client._base_client._headers = new_headers
453453
else:
454-
client._base_client._headers = self._headers.copy()
454+
client._base_client._headers = self._base_client._headers.copy()
455455

456456
if request_timeout is not DEFAULT:
457457
client._base_client._request_timeout = request_timeout

elasticsearch/_sync/client/_base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ def __init__(self, _transport: Transport, headers: HttpHeaders) -> None:
218218
self._ignore_status: Union[DefaultType, Collection[int]] = DEFAULT
219219
self._max_retries: Union[DefaultType, int] = DEFAULT
220220
self._retry_on_status: Union[DefaultType, Collection[int]] = DEFAULT
221+
self._retry_on_timeout: Union[DefaultType, bool] = DEFAULT
221222
self._verified_elasticsearch = False
222223
self._otel = OpenTelemetry()
223224

elasticsearch/helpers/actions.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ def _process_bulk_chunk(
334334
"""
335335
Send a bulk request to elasticsearch and process the output.
336336
"""
337-
with client._otel.use_span(otel_span):
337+
with client._base_client._otel.use_span(otel_span):
338338
if isinstance(ignore_status, int):
339339
ignore_status = (ignore_status,)
340340

@@ -416,9 +416,9 @@ def streaming_bulk(
416416
:arg yield_ok: if set to False will skip successful documents in the output
417417
:arg ignore_status: list of HTTP status code that you want to ignore
418418
"""
419-
with client._otel.helpers_span(span_name) as otel_span:
419+
with client._base_client._otel.helpers_span(span_name) as otel_span:
420420
client = client.options()
421-
client._client_meta = (("h", "bp"),)
421+
client._base_client._client_meta = (("h", "bp"),)
422422

423423
if isinstance(retry_on_status, int):
424424
retry_on_status = (retry_on_status,)
@@ -608,7 +608,7 @@ def _setup_queues(self) -> None:
608608
] = Queue(max(queue_size, thread_count))
609609
self._quick_put = self._inqueue.put
610610

611-
with client._otel.helpers_span("helpers.parallel_bulk") as otel_span:
611+
with client._base_client._otel.helpers_span("helpers.parallel_bulk") as otel_span:
612612
pool = BlockingPool(thread_count)
613613

614614
try:
@@ -711,7 +711,7 @@ def pop_transport_kwargs(kw: MutableMapping[str, Any]) -> Dict[str, Any]:
711711
client = client.options(
712712
request_timeout=request_timeout, **pop_transport_kwargs(kwargs)
713713
)
714-
client._client_meta = (("h", "s"),)
714+
client._base_client._client_meta = (("h", "s"),)
715715

716716
# Setting query={"from": ...} would make 'from' be used
717717
# as a keyword argument instead of 'from_'. We handle that here.

0 commit comments

Comments
 (0)