Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,9 @@ def format_shared_key_credential(account, credential):

def parse_connection_str(conn_str, credential, service):
conn_str = conn_str.rstrip(";")
conn_settings = dict(
conn_settings = dict( # pylint: disable=consider-using-dict-comprehension
[s.split("=", 1) for s in conn_str.split(";")]
) # pylint: disable=consider-using-dict-comprehension
)
endpoints = _SERVICE_PARAMS[service]
primary = None
secondary = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,10 @@ def download_to_stream(self, stream, max_connections=1):
if max_connections > 1:
import concurrent.futures
executor = concurrent.futures.ThreadPoolExecutor(max_connections)
list(executor.map(tracing_context.with_current_context(downloader.process_chunk), downloader.get_chunk_offsets()))
list(executor.map(
tracing_context.with_current_context(downloader.process_chunk),
downloader.get_chunk_offsets()
))
else:
for chunk in downloader.get_chunk_offsets():
downloader.process_chunk(chunk)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,11 @@ def list_containers(
timeout=timeout,
**kwargs)
return AsyncItemPaged(
command, prefix=name_starts_with, results_per_page=results_per_page, page_iterator_class=ContainerPropertiesPaged)
command,
prefix=name_starts_with,
results_per_page=results_per_page,
page_iterator_class=ContainerPropertiesPaged
)

async def create_container(
self, name, # type: str
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,12 @@ def list_blobs(self, name_starts_with=None, include=None, timeout=None, **kwargs
include=include,
timeout=timeout,
**kwargs)
return AsyncItemPaged(command, prefix=name_starts_with, results_per_page=results_per_page, page_iterator_class=BlobPropertiesPaged)
return AsyncItemPaged(
command,
prefix=name_starts_with,
results_per_page=results_per_page,
page_iterator_class=BlobPropertiesPaged
)

def walk_blobs(
self, name_starts_with=None, # type: Optional[str]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,11 @@ def list_containers(
timeout=timeout,
**kwargs)
return ItemPaged(
command, prefix=name_starts_with, results_per_page=results_per_page, page_iterator_class=ContainerPropertiesPaged)
command,
prefix=name_starts_with,
results_per_page=results_per_page,
page_iterator_class=ContainerPropertiesPaged
)

@distributed_trace
def create_container(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
from .blob_client import BlobClient

if TYPE_CHECKING:
from azure.core.pipeline.transport import HttpTransport
from azure.core.pipeline.policies import HTTPPolicy
from azure.core.pipeline.transport import HttpTransport # pylint: disable=ungrouped-imports
from azure.core.pipeline.policies import HTTPPolicy # pylint: disable=ungrouped-imports
from .models import ContainerPermissions, PublicAccess
from datetime import datetime
from .models import ( # pylint: disable=unused-import
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import pytest

import os
import platform
import unittest

from azure.storage.blob import (
Expand Down Expand Up @@ -36,7 +37,8 @@
LARGE_BLOCK_SIZE = 6 * 1024 * 1024

# ------------------------------------------------------------------------------

if platform.python_implementation() == 'PyPy':
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to import platform

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did that :D

pytest.skip("Skip tests for Pypy", allow_module_level=True)

class StorageLargeBlockBlobTest(StorageTestCase):
def setUp(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,9 @@ def format_shared_key_credential(account, credential):

def parse_connection_str(conn_str, credential, service):
conn_str = conn_str.rstrip(";")
conn_settings = dict(
conn_settings = dict( # pylint: disable=consider-using-dict-comprehension
[s.split("=", 1) for s in conn_str.split(";")]
) # pylint: disable=consider-using-dict-comprehension
)
endpoints = _SERVICE_PARAMS[service]
primary = None
secondary = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,10 @@ def download_to_stream(self, stream, max_connections=1):
if max_connections > 1:
import concurrent.futures
executor = concurrent.futures.ThreadPoolExecutor(max_connections)
list(executor.map(tracing_context.with_current_context(downloader.process_chunk), downloader.get_chunk_offsets()))
list(executor.map(
tracing_context.with_current_context(downloader.process_chunk),
downloader.get_chunk_offsets()
))
else:
for chunk in downloader.get_chunk_offsets():
downloader.process_chunk(chunk)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -728,4 +728,3 @@ async def close_handles(

polling_method = CloseHandlesAsync(self._config.copy_polling_interval)
return async_poller(command, start_close, None, polling_method)

Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,9 @@ def format_shared_key_credential(account, credential):

def parse_connection_str(conn_str, credential, service):
conn_str = conn_str.rstrip(";")
conn_settings = dict(
conn_settings = dict( # pylint: disable=consider-using-dict-comprehension
[s.split("=", 1) for s in conn_str.split(";")]
) # pylint: disable=consider-using-dict-comprehension
)
endpoints = _SERVICE_PARAMS[service]
primary = None
secondary = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,10 @@ def download_to_stream(self, stream, max_connections=1):
if max_connections > 1:
import concurrent.futures
executor = concurrent.futures.ThreadPoolExecutor(max_connections)
list(executor.map(tracing_context.with_current_context(downloader.process_chunk), downloader.get_chunk_offsets()))
list(executor.map(
tracing_context.with_current_context(downloader.process_chunk),
downloader.get_chunk_offsets()
))
else:
for chunk in downloader.get_chunk_offsets():
downloader.process_chunk(chunk)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,5 @@ async def _extract_data_cb(self, get_next_return):
self.prefix = self._response.prefix
self.marker = self._response.marker
self.results_per_page = self._response.max_results

return self._response.next_marker or None, [QueueProperties._from_generated(q) for q in self._response.queue_items] # pylint: disable=protected-access
props_list = [QueueProperties._from_generated(q) for q in self._response.queue_items] # pylint: disable=protected-access
return self._response.next_marker or None, props_list
Original file line number Diff line number Diff line change
Expand Up @@ -657,4 +657,3 @@ async def delete_message(self, message, pop_receipt=None, timeout=None, **kwargs
)
except StorageErrorException as error:
process_storage_error(error)

6 changes: 3 additions & 3 deletions sdk/storage/azure-storage-queue/azure/storage/queue/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def _get_next_cb(self, continuation_token):
except StorageErrorException as error:
process_storage_error(error)

def _extract_data_cb(self, messages):
def _extract_data_cb(self, messages): # pylint: disable=no-self-use
# There is no concept of continuation token, so raising on my own condition
if not messages:
raise StopIteration("End of paging")
Expand Down Expand Up @@ -327,8 +327,8 @@ def _extract_data_cb(self, get_next_return):
self.prefix = self._response.prefix
self.marker = self._response.marker
self.results_per_page = self._response.max_results

return self._response.next_marker or None, [QueueProperties._from_generated(q) for q in self._response.queue_items] # pylint: disable=protected-access
props_list = [QueueProperties._from_generated(q) for q in self._response.queue_items] # pylint: disable=protected-access
return self._response.next_marker or None, props_list


class QueuePermissions(object):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import six

from azure.core.paging import ItemPaged

from azure.core.tracing.decorator import distributed_trace
from ._shared.shared_access_signature import QueueSharedAccessSignature
from ._shared.base_client import StorageAccountHostsMixin, parse_connection_str, parse_query
from ._shared.request_handlers import add_metadata_headers, serialize_iso
Expand All @@ -30,7 +30,6 @@
from ._generated import AzureQueueStorage
from ._generated.models import StorageErrorException, SignedIdentifier
from ._generated.models import QueueMessage as GenQueueMessage
from azure.core.tracing.decorator import distributed_trace

from .models import QueueMessage, AccessPolicy, MessagesPaged

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from urlparse import urlparse # type: ignore

from azure.core.paging import ItemPaged

from azure.core.tracing.decorator import distributed_trace
from ._shared.shared_access_signature import SharedAccessSignature
from ._shared.models import LocationMode, Services
from ._shared.base_client import StorageAccountHostsMixin, parse_connection_str, parse_query
Expand All @@ -24,7 +24,6 @@

from .models import QueuePropertiesPaged
from .queue_client import QueueClient
from azure.core.tracing.decorator import distributed_trace

if TYPE_CHECKING:
from datetime import datetime
Expand Down
3 changes: 3 additions & 0 deletions sdk/storage/azure-storage-queue/tests/test_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import unittest
import pytest
import sys
from dateutil.tz import tzutc
from datetime import (
datetime,
Expand Down Expand Up @@ -814,6 +815,7 @@ def test_unicode_create_queue_unicode_name(self):
@record
def test_unicode_get_messages_unicode_data(self):
# Action
pytest.skip("Uncomment after msrest fix")
queue_client = self._create_queue()
queue_client.enqueue_message(u'message1㚈')
message = next(queue_client.receive_messages())
Expand All @@ -831,6 +833,7 @@ def test_unicode_get_messages_unicode_data(self):
@record
def test_unicode_update_message_unicode_data(self):
# Action
pytest.skip("Uncomment after msrest fix")
queue_client = self._create_queue()
queue_client.enqueue_message(u'message1')
messages = queue_client.receive_messages()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def test_set_access_policy(self):
queue_client.create_queue()
except ResourceExistsError:
pass
queue_client.enqueue_message('hello world')
queue_client.enqueue_message(u"hello world")

try:
# [START set_access_policy]
Expand Down