Skip to content

Commit 66f3395

Browse files
authored
apply black so that core CI will continue to be green (Azure#29001)
1 parent a6ede0d commit 66f3395

File tree

4 files changed

+15
-49
lines changed

4 files changed

+15
-49
lines changed

sdk/core/azure-core/azure/core/_pipeline_client_async.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -182,14 +182,8 @@ async def __aexit__(self, *args):
182182
async def close(self):
183183
await self._pipeline.__aexit__()
184184

185-
def _build_pipeline( # pylint: disable=no-self-use
186-
self,
187-
config: Configuration,
188-
*,
189-
policies=None,
190-
per_call_policies=None,
191-
per_retry_policies=None,
192-
**kwargs
185+
def _build_pipeline( # pylint: disable=no-self-use
186+
self, config: Configuration, *, policies=None, per_call_policies=None, per_retry_policies=None, **kwargs
193187
) -> AsyncPipeline[HTTPRequestType, AsyncHTTPResponseType]:
194188
transport = kwargs.get("transport")
195189
per_call_policies = per_call_policies or []
@@ -259,13 +253,9 @@ def _build_pipeline( # pylint: disable=no-self-use
259253

260254
transport = AioHttpTransport(**kwargs)
261255

262-
return AsyncPipeline[HTTPRequestType, AsyncHTTPResponseType](
263-
transport, policies
264-
)
256+
return AsyncPipeline[HTTPRequestType, AsyncHTTPResponseType](transport, policies)
265257

266-
async def _make_pipeline_call(
267-
self, request: HTTPRequestType, **kwargs
268-
) -> AsyncHTTPResponseType:
258+
async def _make_pipeline_call(self, request: HTTPRequestType, **kwargs) -> AsyncHTTPResponseType:
269259
return_pipeline_response = kwargs.pop("_return_pipeline_response", False)
270260
pipeline_response = await self._pipeline.run(request, **kwargs) # pylint: disable=protected-access
271261
if return_pipeline_response:

sdk/core/azure-core/azure/core/pipeline/_base.py

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,11 @@ class _SansIOHTTPPolicyRunner(HTTPPolicy[HTTPRequestType, HTTPResponseType]):
5353
:type policy: ~azure.core.pipeline.policies.SansIOHTTPPolicy
5454
"""
5555

56-
def __init__(
57-
self, policy: SansIOHTTPPolicy[HTTPRequestType, HTTPResponseType]
58-
) -> None:
56+
def __init__(self, policy: SansIOHTTPPolicy[HTTPRequestType, HTTPResponseType]) -> None:
5957
super(_SansIOHTTPPolicyRunner, self).__init__()
6058
self._policy = policy
6159

62-
def send(
63-
self, request: PipelineRequest[HTTPRequestType]
64-
) -> PipelineResponse[HTTPRequestType, HTTPResponseType]:
60+
def send(self, request: PipelineRequest[HTTPRequestType]) -> PipelineResponse[HTTPRequestType, HTTPResponseType]:
6561
"""Modifies the request and sends to the next policy in the chain.
6662
6763
:param request: The PipelineRequest object.
@@ -88,15 +84,11 @@ class _TransportRunner(HTTPPolicy[HTTPRequestType, HTTPResponseType]):
8884
:param sender: The Http Transport instance.
8985
"""
9086

91-
def __init__(
92-
self, sender: HttpTransport[HTTPRequestType, HTTPResponseType]
93-
) -> None:
87+
def __init__(self, sender: HttpTransport[HTTPRequestType, HTTPResponseType]) -> None:
9488
super(_TransportRunner, self).__init__()
9589
self._sender = sender
9690

97-
def send(
98-
self, request: PipelineRequest[HTTPRequestType]
99-
) -> PipelineResponse[HTTPRequestType, HTTPResponseType]:
91+
def send(self, request: PipelineRequest[HTTPRequestType]) -> PipelineResponse[HTTPRequestType, HTTPResponseType]:
10092
"""HTTP transport send method.
10193
10294
:param request: The PipelineRequest object.
@@ -195,9 +187,7 @@ def _prepare_multipart(self, request: HTTPRequestType) -> None:
195187
self._prepare_multipart_mixed_request(request)
196188
request.prepare_multipart_body() # type: ignore
197189

198-
def run(
199-
self, request: HTTPRequestType, **kwargs: Any
200-
) -> PipelineResponse[HTTPRequestType, HTTPResponseType]:
190+
def run(self, request: HTTPRequestType, **kwargs: Any) -> PipelineResponse[HTTPRequestType, HTTPResponseType]:
201191
"""Runs the HTTP Request through the chained policies.
202192
203193
:param request: The HTTP request object.
@@ -207,12 +197,6 @@ def run(
207197
"""
208198
self._prepare_multipart(request)
209199
context = PipelineContext(self._transport, **kwargs)
210-
pipeline_request: PipelineRequest[HTTPRequestType] = PipelineRequest(
211-
request, context
212-
)
213-
first_node = (
214-
self._impl_policies[0]
215-
if self._impl_policies
216-
else _TransportRunner(self._transport)
217-
)
200+
pipeline_request: PipelineRequest[HTTPRequestType] = PipelineRequest(request, context)
201+
first_node = self._impl_policies[0] if self._impl_policies else _TransportRunner(self._transport)
218202
return first_node.send(pipeline_request)

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

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ class _SansIOAsyncHTTPPolicyRunner(
5050
:type policy: ~azure.core.pipeline.policies.SansIOHTTPPolicy
5151
"""
5252

53-
def __init__(
54-
self, policy: SansIOHTTPPolicy[HTTPRequestType, AsyncHTTPResponseType]
55-
) -> None:
53+
def __init__(self, policy: SansIOHTTPPolicy[HTTPRequestType, AsyncHTTPResponseType]) -> None:
5654
super(_SansIOAsyncHTTPPolicyRunner, self).__init__()
5755
self._policy = policy
5856

@@ -88,9 +86,7 @@ class _AsyncTransportRunner(
8886
:param sender: The async Http Transport instance.
8987
"""
9088

91-
def __init__(
92-
self, sender: AsyncHttpTransport[HTTPRequestType, AsyncHTTPResponseType]
93-
) -> None:
89+
def __init__(self, sender: AsyncHttpTransport[HTTPRequestType, AsyncHTTPResponseType]) -> None:
9490
super(_AsyncTransportRunner, self).__init__()
9591
self._sender = sender
9692

@@ -135,9 +131,7 @@ def __init__(
135131
transport: AsyncHttpTransport[HTTPRequestType, AsyncHTTPResponseType],
136132
policies: Optional[AsyncPoliciesType] = None,
137133
) -> None:
138-
self._impl_policies: List[
139-
AsyncHTTPPolicy[HTTPRequestType, AsyncHTTPResponseType]
140-
] = []
134+
self._impl_policies: List[AsyncHTTPPolicy[HTTPRequestType, AsyncHTTPResponseType]] = []
141135
self._transport = transport
142136

143137
for policy in policies or []:

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,9 +311,7 @@ async def __anext__(self):
311311
if not self._decompressor:
312312
import zlib
313313

314-
zlib_mode = (
315-
(16 + zlib.MAX_WBITS) if enc == "gzip" else -zlib.MAX_WBITS
316-
)
314+
zlib_mode = (16 + zlib.MAX_WBITS) if enc == "gzip" else -zlib.MAX_WBITS
317315
self._decompressor = zlib.decompressobj(wbits=zlib_mode)
318316
chunk = self._decompressor.decompress(chunk)
319317
return chunk

0 commit comments

Comments
 (0)