Skip to content

Commit 5665c17

Browse files
author
Rakshith Bhyravabhotla
authored
Some final tweaks (#6687)
* Some final tweaks * oops * comments * little better * Pylint
1 parent 1c44a9c commit 5665c17

File tree

19 files changed

+50
-27
lines changed

19 files changed

+50
-27
lines changed

sdk/storage/azure-storage-blob/azure/storage/blob/_shared/base_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,9 @@ def format_shared_key_credential(account, credential):
197197

198198
def parse_connection_str(conn_str, credential, service):
199199
conn_str = conn_str.rstrip(";")
200-
conn_settings = dict(
200+
conn_settings = dict( # pylint: disable=consider-using-dict-comprehension
201201
[s.split("=", 1) for s in conn_str.split(";")]
202-
) # pylint: disable=consider-using-dict-comprehension
202+
)
203203
endpoints = _SERVICE_PARAMS[service]
204204
primary = None
205205
secondary = None

sdk/storage/azure-storage-blob/azure/storage/blob/_shared/downloads.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,10 @@ def download_to_stream(self, stream, max_connections=1):
465465
if max_connections > 1:
466466
import concurrent.futures
467467
executor = concurrent.futures.ThreadPoolExecutor(max_connections)
468-
list(executor.map(tracing_context.with_current_context(downloader.process_chunk), downloader.get_chunk_offsets()))
468+
list(executor.map(
469+
tracing_context.with_current_context(downloader.process_chunk),
470+
downloader.get_chunk_offsets()
471+
))
469472
else:
470473
for chunk in downloader.get_chunk_offsets():
471474
downloader.process_chunk(chunk)

sdk/storage/azure-storage-blob/azure/storage/blob/aio/blob_service_client_async.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,11 @@ def list_containers(
310310
timeout=timeout,
311311
**kwargs)
312312
return AsyncItemPaged(
313-
command, prefix=name_starts_with, results_per_page=results_per_page, page_iterator_class=ContainerPropertiesPaged)
313+
command,
314+
prefix=name_starts_with,
315+
results_per_page=results_per_page,
316+
page_iterator_class=ContainerPropertiesPaged
317+
)
314318

315319
async def create_container(
316320
self, name, # type: str

sdk/storage/azure-storage-blob/azure/storage/blob/aio/container_client_async.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,12 @@ def list_blobs(self, name_starts_with=None, include=None, timeout=None, **kwargs
511511
include=include,
512512
timeout=timeout,
513513
**kwargs)
514-
return AsyncItemPaged(command, prefix=name_starts_with, results_per_page=results_per_page, page_iterator_class=BlobPropertiesPaged)
514+
return AsyncItemPaged(
515+
command,
516+
prefix=name_starts_with,
517+
results_per_page=results_per_page,
518+
page_iterator_class=BlobPropertiesPaged
519+
)
515520

516521
def walk_blobs(
517522
self, name_starts_with=None, # type: Optional[str]

sdk/storage/azure-storage-blob/azure/storage/blob/blob_service_client.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,11 @@ def list_containers(
424424
timeout=timeout,
425425
**kwargs)
426426
return ItemPaged(
427-
command, prefix=name_starts_with, results_per_page=results_per_page, page_iterator_class=ContainerPropertiesPaged)
427+
command,
428+
prefix=name_starts_with,
429+
results_per_page=results_per_page,
430+
page_iterator_class=ContainerPropertiesPaged
431+
)
428432

429433
@distributed_trace
430434
def create_container(

sdk/storage/azure-storage-blob/azure/storage/blob/container_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
from .blob_client import BlobClient
4545

4646
if TYPE_CHECKING:
47-
from azure.core.pipeline.transport import HttpTransport
48-
from azure.core.pipeline.policies import HTTPPolicy
47+
from azure.core.pipeline.transport import HttpTransport # pylint: disable=ungrouped-imports
48+
from azure.core.pipeline.policies import HTTPPolicy # pylint: disable=ungrouped-imports
4949
from .models import ContainerPermissions, PublicAccess
5050
from datetime import datetime
5151
from .models import ( # pylint: disable=unused-import

sdk/storage/azure-storage-blob/tests/test_large_block_blob.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import pytest
1010

1111
import os
12+
import platform
1213
import unittest
1314

1415
from azure.storage.blob import (
@@ -36,7 +37,8 @@
3637
LARGE_BLOCK_SIZE = 6 * 1024 * 1024
3738

3839
# ------------------------------------------------------------------------------
39-
40+
if platform.python_implementation() == 'PyPy':
41+
pytest.skip("Skip tests for Pypy", allow_module_level=True)
4042

4143
class StorageLargeBlockBlobTest(StorageTestCase):
4244
def setUp(self):

sdk/storage/azure-storage-file/azure/storage/file/_shared/base_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,9 @@ def format_shared_key_credential(account, credential):
197197

198198
def parse_connection_str(conn_str, credential, service):
199199
conn_str = conn_str.rstrip(";")
200-
conn_settings = dict(
200+
conn_settings = dict( # pylint: disable=consider-using-dict-comprehension
201201
[s.split("=", 1) for s in conn_str.split(";")]
202-
) # pylint: disable=consider-using-dict-comprehension
202+
)
203203
endpoints = _SERVICE_PARAMS[service]
204204
primary = None
205205
secondary = None

sdk/storage/azure-storage-file/azure/storage/file/_shared/downloads.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,10 @@ def download_to_stream(self, stream, max_connections=1):
465465
if max_connections > 1:
466466
import concurrent.futures
467467
executor = concurrent.futures.ThreadPoolExecutor(max_connections)
468-
list(executor.map(tracing_context.with_current_context(downloader.process_chunk), downloader.get_chunk_offsets()))
468+
list(executor.map(
469+
tracing_context.with_current_context(downloader.process_chunk),
470+
downloader.get_chunk_offsets()
471+
))
469472
else:
470473
for chunk in downloader.get_chunk_offsets():
471474
downloader.process_chunk(chunk)

sdk/storage/azure-storage-file/azure/storage/file/aio/file_client_async.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -728,4 +728,3 @@ async def close_handles(
728728

729729
polling_method = CloseHandlesAsync(self._config.copy_polling_interval)
730730
return async_poller(command, start_close, None, polling_method)
731-

0 commit comments

Comments
 (0)