diff --git a/sdk/core/azure-core-experimental/azure/core/experimental/transport/_httpx.py b/sdk/core/azure-core-experimental/azure/core/experimental/transport/_httpx.py index 431e0fb939c9..fabb85e4051b 100644 --- a/sdk/core/azure-core-experimental/azure/core/experimental/transport/_httpx.py +++ b/sdk/core/azure-core-experimental/azure/core/experimental/transport/_httpx.py @@ -25,7 +25,7 @@ # -------------------------------------------------------------------------- from typing import Any, ContextManager, Iterator, Optional, Union -import httpx +import httpx # pylint: disable=networking-import-outside-azure-core-transport from azure.core.configuration import ConnectionConfiguration from azure.core.exceptions import DecodeError, ServiceRequestError, ServiceResponseError from azure.core.pipeline import Pipeline diff --git a/sdk/core/azure-core-experimental/azure/core/experimental/transport/_httpx_async.py b/sdk/core/azure-core-experimental/azure/core/experimental/transport/_httpx_async.py index 1f96a9c20d42..9a060b8a9bd3 100644 --- a/sdk/core/azure-core-experimental/azure/core/experimental/transport/_httpx_async.py +++ b/sdk/core/azure-core-experimental/azure/core/experimental/transport/_httpx_async.py @@ -25,7 +25,7 @@ # -------------------------------------------------------------------------- from typing import Any, AsyncIterator, ContextManager, Optional, Union -import httpx +import httpx # pylint: disable=networking-import-outside-azure-core-transport from azure.core.configuration import ConnectionConfiguration from azure.core.exceptions import DecodeError, ServiceRequestError, ServiceResponseError from azure.core.pipeline import Pipeline diff --git a/sdk/core/azure-core/azure/core/pipeline/transport/_base_async.py b/sdk/core/azure-core/azure/core/pipeline/transport/_base_async.py index f7025cb935b5..28565a8b70e7 100644 --- a/sdk/core/azure-core/azure/core/pipeline/transport/_base_async.py +++ b/sdk/core/azure-core/azure/core/pipeline/transport/_base_async.py @@ -118,7 +118,9 @@ async def __aexit__( return None -class AsyncHttpClientTransportResponse(_HttpClientTransportResponse, AsyncHttpResponse): +class AsyncHttpClientTransportResponse( + _HttpClientTransportResponse, AsyncHttpResponse +): # pylint: disable=abstract-method """Create a HTTPResponse from an http.client response. Body will NOT be read by the constructor. Call "body()" to load the body in memory if necessary. diff --git a/sdk/core/azure-core/azure/core/rest/_aiohttp.py b/sdk/core/azure-core/azure/core/rest/_aiohttp.py index ebcae4844872..9ffb173c74d2 100644 --- a/sdk/core/azure-core/azure/core/rest/_aiohttp.py +++ b/sdk/core/azure-core/azure/core/rest/_aiohttp.py @@ -28,7 +28,7 @@ from itertools import groupby from typing import Iterator, cast -import aiohttp +import aiohttp # pylint: disable=networking-import-outside-azure-core-transport from multidict import CIMultiDict from ._http_response_impl_async import ( diff --git a/sdk/core/corehttp/corehttp/rest/_aiohttp.py b/sdk/core/corehttp/corehttp/rest/_aiohttp.py index dccec1ec4dd5..a9efbe0f8244 100644 --- a/sdk/core/corehttp/corehttp/rest/_aiohttp.py +++ b/sdk/core/corehttp/corehttp/rest/_aiohttp.py @@ -300,7 +300,7 @@ async def __anext__(self): except aiohttp.client_exceptions.ClientPayloadError as err: # This is the case that server closes connection before we finish the reading. aiohttp library # raises ClientPayloadError. - _LOGGER.warning("Incomplete download: %s", err) + _LOGGER.warning("Incomplete download.") internal_response.close() raise IncompleteReadError(err, error=err) from err except aiohttp.client_exceptions.ClientResponseError as err: @@ -309,7 +309,7 @@ async def __anext__(self): raise ServiceResponseError(err, error=err) from err except aiohttp.client_exceptions.ClientError as err: raise ServiceRequestError(err, error=err) from err - except Exception as err: - _LOGGER.warning("Unable to stream download: %s", err) + except Exception: + _LOGGER.warning("Unable to stream download.") internal_response.close() raise diff --git a/sdk/core/corehttp/corehttp/rest/_httpx.py b/sdk/core/corehttp/corehttp/rest/_httpx.py index ac97461bfe24..9e0b15ecfd01 100644 --- a/sdk/core/corehttp/corehttp/rest/_httpx.py +++ b/sdk/core/corehttp/corehttp/rest/_httpx.py @@ -96,10 +96,10 @@ def __next__(self): except httpx.RemoteProtocolError as ex: msg = ex.__str__() if "complete message" in msg: - _LOGGER.warning("Incomplete download: %s", ex) + _LOGGER.warning("Incomplete download.") internal_response.close() raise IncompleteReadError(ex, error=ex) from ex - _LOGGER.warning("Unable to stream download: %s", ex) + _LOGGER.warning("Unable to stream download.") internal_response.close() raise HttpResponseError(ex, error=ex) from ex except httpx.DecodingError as ex: @@ -108,8 +108,8 @@ def __next__(self): raise DecodeError("Failed to decode.", error=ex) from ex except httpx.RequestError as err: raise ServiceRequestError(err, error=err) from err - except Exception as err: - _LOGGER.warning("Unable to stream download: %s", err) + except Exception: + _LOGGER.warning("Unable to stream download.") internal_response.close() raise @@ -186,10 +186,10 @@ async def __anext__(self): except httpx.RemoteProtocolError as ex: msg = ex.__str__() if "complete message" in msg: - _LOGGER.warning("Incomplete download: %s", ex) + _LOGGER.warning("Incomplete download.") await internal_response.aclose() raise IncompleteReadError(ex, error=ex) from ex - _LOGGER.warning("Unable to stream download: %s", ex) + _LOGGER.warning("Unable to stream download.") await internal_response.aclose() raise HttpResponseError(ex, error=ex) from ex except httpx.DecodingError as ex: @@ -198,7 +198,7 @@ async def __anext__(self): raise DecodeError("Failed to decode.", error=ex) from ex except httpx.RequestError as err: raise ServiceRequestError(err, error=err) from err - except Exception as err: - _LOGGER.warning("Unable to stream download: %s", err) + except Exception: + _LOGGER.warning("Unable to stream download.") await internal_response.aclose() raise diff --git a/sdk/core/corehttp/corehttp/rest/_requests_basic.py b/sdk/core/corehttp/corehttp/rest/_requests_basic.py index b1205d273150..dd98a9ccf69a 100644 --- a/sdk/core/corehttp/corehttp/rest/_requests_basic.py +++ b/sdk/core/corehttp/corehttp/rest/_requests_basic.py @@ -156,14 +156,14 @@ def __next__(self): except requests.exceptions.ChunkedEncodingError as err: msg = err.__str__() if "IncompleteRead" in msg: - _LOGGER.warning("Incomplete download: %s", err) + _LOGGER.warning("Incomplete download.") internal_response.close() raise IncompleteReadError(err, error=err) from err - _LOGGER.warning("Unable to stream download: %s", err) + _LOGGER.warning("Unable to stream download.") internal_response.close() raise HttpResponseError(err, error=err) from err except Exception as err: - _LOGGER.warning("Unable to stream download: %s", err) + _LOGGER.warning("Unable to stream download.") internal_response.close() raise diff --git a/sdk/core/corehttp/corehttp/runtime/policies/_distributed_tracing.py b/sdk/core/corehttp/corehttp/runtime/policies/_distributed_tracing.py index d283bd68089f..a26b63c0bc3c 100644 --- a/sdk/core/corehttp/corehttp/runtime/policies/_distributed_tracing.py +++ b/sdk/core/corehttp/corehttp/runtime/policies/_distributed_tracing.py @@ -96,7 +96,7 @@ def on_request(self, request: PipelineRequest[HttpRequest]) -> None: token = tracer._suppress_auto_http_instrumentation() # pylint: disable=protected-access request.context[self._SUPPRESSION_TOKEN] = token except Exception as err: # pylint: disable=broad-except - _LOGGER.warning("Unable to start HTTP span: %s", err) + _LOGGER.warning("Unable to start HTTP span: %s", err) # pylint: disable=do-not-log-exceptions-if-not-debug def on_response( self, diff --git a/sdk/core/corehttp/corehttp/transport/requests/_requests_basic.py b/sdk/core/corehttp/corehttp/transport/requests/_requests_basic.py index 6484fed13af6..e3e45b091f92 100644 --- a/sdk/core/corehttp/corehttp/transport/requests/_requests_basic.py +++ b/sdk/core/corehttp/corehttp/transport/requests/_requests_basic.py @@ -180,10 +180,10 @@ def send( except requests.exceptions.ChunkedEncodingError as err: msg = err.__str__() if "IncompleteRead" in msg: - _LOGGER.warning("Incomplete download: %s", err) + _LOGGER.warning("Incomplete download.") error = IncompleteReadError(err, error=err) else: - _LOGGER.warning("Unable to stream download: %s", err) + _LOGGER.warning("Unable to stream download.") error = HttpResponseError(err, error=err) except requests.RequestException as err: error = ServiceRequestError(err, error=err)