Skip to content

Commit 0d10b60

Browse files
committed
[Core] Update for next-pylint
Signed-off-by: Paul Van Eck <[email protected]>
1 parent 6a3f52a commit 0d10b60

File tree

9 files changed

+23
-21
lines changed

9 files changed

+23
-21
lines changed

sdk/core/azure-core-experimental/azure/core/experimental/transport/_httpx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
# --------------------------------------------------------------------------
2626
from typing import Any, ContextManager, Iterator, Optional, Union
2727

28-
import httpx
28+
import httpx # pylint: disable=networking-import-outside-azure-core-transport
2929
from azure.core.configuration import ConnectionConfiguration
3030
from azure.core.exceptions import DecodeError, ServiceRequestError, ServiceResponseError
3131
from azure.core.pipeline import Pipeline

sdk/core/azure-core-experimental/azure/core/experimental/transport/_httpx_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
# --------------------------------------------------------------------------
2626
from typing import Any, AsyncIterator, ContextManager, Optional, Union
2727

28-
import httpx
28+
import httpx # pylint: disable=networking-import-outside-azure-core-transport
2929
from azure.core.configuration import ConnectionConfiguration
3030
from azure.core.exceptions import DecodeError, ServiceRequestError, ServiceResponseError
3131
from azure.core.pipeline import Pipeline

sdk/core/azure-core/azure/core/pipeline/transport/_base_async.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@ async def __aexit__(
118118
return None
119119

120120

121-
class AsyncHttpClientTransportResponse(_HttpClientTransportResponse, AsyncHttpResponse):
121+
class AsyncHttpClientTransportResponse(
122+
_HttpClientTransportResponse, AsyncHttpResponse
123+
): # pylint: disable=abstract-method
122124
"""Create a HTTPResponse from an http.client response.
123125
124126
Body will NOT be read by the constructor. Call "body()" to load the body in memory if necessary.

sdk/core/azure-core/azure/core/rest/_aiohttp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
from itertools import groupby
2929
from typing import Iterator, cast
3030

31-
import aiohttp
31+
import aiohttp # pylint: disable=networking-import-outside-azure-core-transport
3232
from multidict import CIMultiDict
3333

3434
from ._http_response_impl_async import (

sdk/core/corehttp/corehttp/rest/_aiohttp.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ async def __anext__(self):
300300
except aiohttp.client_exceptions.ClientPayloadError as err:
301301
# This is the case that server closes connection before we finish the reading. aiohttp library
302302
# raises ClientPayloadError.
303-
_LOGGER.warning("Incomplete download: %s", err)
303+
_LOGGER.warning("Incomplete download.")
304304
internal_response.close()
305305
raise IncompleteReadError(err, error=err) from err
306306
except aiohttp.client_exceptions.ClientResponseError as err:
@@ -309,7 +309,7 @@ async def __anext__(self):
309309
raise ServiceResponseError(err, error=err) from err
310310
except aiohttp.client_exceptions.ClientError as err:
311311
raise ServiceRequestError(err, error=err) from err
312-
except Exception as err:
313-
_LOGGER.warning("Unable to stream download: %s", err)
312+
except Exception:
313+
_LOGGER.warning("Unable to stream download.")
314314
internal_response.close()
315315
raise

sdk/core/corehttp/corehttp/rest/_httpx.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@ def __next__(self):
9696
except httpx.RemoteProtocolError as ex:
9797
msg = ex.__str__()
9898
if "complete message" in msg:
99-
_LOGGER.warning("Incomplete download: %s", ex)
99+
_LOGGER.warning("Incomplete download.")
100100
internal_response.close()
101101
raise IncompleteReadError(ex, error=ex) from ex
102-
_LOGGER.warning("Unable to stream download: %s", ex)
102+
_LOGGER.warning("Unable to stream download.")
103103
internal_response.close()
104104
raise HttpResponseError(ex, error=ex) from ex
105105
except httpx.DecodingError as ex:
@@ -108,8 +108,8 @@ def __next__(self):
108108
raise DecodeError("Failed to decode.", error=ex) from ex
109109
except httpx.RequestError as err:
110110
raise ServiceRequestError(err, error=err) from err
111-
except Exception as err:
112-
_LOGGER.warning("Unable to stream download: %s", err)
111+
except Exception:
112+
_LOGGER.warning("Unable to stream download.")
113113
internal_response.close()
114114
raise
115115

@@ -186,10 +186,10 @@ async def __anext__(self):
186186
except httpx.RemoteProtocolError as ex:
187187
msg = ex.__str__()
188188
if "complete message" in msg:
189-
_LOGGER.warning("Incomplete download: %s", ex)
189+
_LOGGER.warning("Incomplete download.")
190190
await internal_response.aclose()
191191
raise IncompleteReadError(ex, error=ex) from ex
192-
_LOGGER.warning("Unable to stream download: %s", ex)
192+
_LOGGER.warning("Unable to stream download.")
193193
await internal_response.aclose()
194194
raise HttpResponseError(ex, error=ex) from ex
195195
except httpx.DecodingError as ex:
@@ -198,7 +198,7 @@ async def __anext__(self):
198198
raise DecodeError("Failed to decode.", error=ex) from ex
199199
except httpx.RequestError as err:
200200
raise ServiceRequestError(err, error=err) from err
201-
except Exception as err:
202-
_LOGGER.warning("Unable to stream download: %s", err)
201+
except Exception:
202+
_LOGGER.warning("Unable to stream download.")
203203
await internal_response.aclose()
204204
raise

sdk/core/corehttp/corehttp/rest/_requests_basic.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,14 +156,14 @@ def __next__(self):
156156
except requests.exceptions.ChunkedEncodingError as err:
157157
msg = err.__str__()
158158
if "IncompleteRead" in msg:
159-
_LOGGER.warning("Incomplete download: %s", err)
159+
_LOGGER.warning("Incomplete download.")
160160
internal_response.close()
161161
raise IncompleteReadError(err, error=err) from err
162-
_LOGGER.warning("Unable to stream download: %s", err)
162+
_LOGGER.warning("Unable to stream download.")
163163
internal_response.close()
164164
raise HttpResponseError(err, error=err) from err
165165
except Exception as err:
166-
_LOGGER.warning("Unable to stream download: %s", err)
166+
_LOGGER.warning("Unable to stream download.")
167167
internal_response.close()
168168
raise
169169

sdk/core/corehttp/corehttp/runtime/policies/_distributed_tracing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def on_request(self, request: PipelineRequest[HttpRequest]) -> None:
9696
token = tracer._suppress_auto_http_instrumentation() # pylint: disable=protected-access
9797
request.context[self._SUPPRESSION_TOKEN] = token
9898
except Exception as err: # pylint: disable=broad-except
99-
_LOGGER.warning("Unable to start HTTP span: %s", err)
99+
_LOGGER.warning("Unable to start HTTP span: %s", err) # pylint: disable=do-not-log-exceptions-if-not-debug
100100

101101
def on_response(
102102
self,

sdk/core/corehttp/corehttp/transport/requests/_requests_basic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,10 @@ def send(
180180
except requests.exceptions.ChunkedEncodingError as err:
181181
msg = err.__str__()
182182
if "IncompleteRead" in msg:
183-
_LOGGER.warning("Incomplete download: %s", err)
183+
_LOGGER.warning("Incomplete download.")
184184
error = IncompleteReadError(err, error=err)
185185
else:
186-
_LOGGER.warning("Unable to stream download: %s", err)
186+
_LOGGER.warning("Unable to stream download.")
187187
error = HttpResponseError(err, error=err)
188188
except requests.RequestException as err:
189189
error = ServiceRequestError(err, error=err)

0 commit comments

Comments
 (0)