From 752a0f230d347757d2b2e0af4dc8bef165fe6098 Mon Sep 17 00:00:00 2001 From: Krista Pratico Date: Mon, 14 Oct 2019 11:19:04 -0700 Subject: [PATCH 1/3] await files async poller --- .../azure/storage/file/aio/directory_client_async.py | 2 +- .../azure/storage/file/aio/file_client_async.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/storage/azure-storage-file/azure/storage/file/aio/directory_client_async.py b/sdk/storage/azure-storage-file/azure/storage/file/aio/directory_client_async.py index 524b30ea28d3..4fa12a09e8db 100644 --- a/sdk/storage/azure-storage-file/azure/storage/file/aio/directory_client_async.py +++ b/sdk/storage/azure-storage-file/azure/storage/file/aio/directory_client_async.py @@ -301,7 +301,7 @@ async def close_handles( process_storage_error(error) polling_method = CloseHandlesAsync(self._config.copy_polling_interval) - return async_poller( + return await async_poller( command, start_close, None, diff --git a/sdk/storage/azure-storage-file/azure/storage/file/aio/file_client_async.py b/sdk/storage/azure-storage-file/azure/storage/file/aio/file_client_async.py index c5493ca350d1..eb9eef4dcc68 100644 --- a/sdk/storage/azure-storage-file/azure/storage/file/aio/file_client_async.py +++ b/sdk/storage/azure-storage-file/azure/storage/file/aio/file_client_async.py @@ -909,4 +909,4 @@ async def close_handles( process_storage_error(error) polling_method = CloseHandlesAsync(self._config.copy_polling_interval) - return async_poller(command, start_close, None, polling_method) + return await async_poller(command, start_close, None, polling_method) From ce1a616b0b4718472365a160d82f4833179ed557 Mon Sep 17 00:00:00 2001 From: Krista Pratico Date: Mon, 14 Oct 2019 13:19:14 -0700 Subject: [PATCH 2/3] fix docstrings --- .../azure/storage/file/aio/directory_client_async.py | 7 ++----- .../azure/storage/file/aio/file_client_async.py | 7 ++----- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/sdk/storage/azure-storage-file/azure/storage/file/aio/directory_client_async.py b/sdk/storage/azure-storage-file/azure/storage/file/aio/directory_client_async.py index 4fa12a09e8db..2154dacf9499 100644 --- a/sdk/storage/azure-storage-file/azure/storage/file/aio/directory_client_async.py +++ b/sdk/storage/azure-storage-file/azure/storage/file/aio/directory_client_async.py @@ -268,9 +268,6 @@ async def close_handles( # type: (...) -> Any """Close open file handles. - This operation may not finish with a single call, so a long-running poller - is returned that can be used to wait until the operation is complete. - :param handle: Optionally, a specific handle to close. The default value is '*' which will attempt to close all open handles. @@ -280,8 +277,8 @@ async def close_handles( its files, its subdirectories and their files. Default value is False. :param int timeout: The timeout parameter is expressed in seconds. - :returns: A long-running poller to get operation status. - :rtype: ~azure.core.polling.LROPoller + :returns: The number of file handles that were closed. + :rtype: int """ try: handle_id = handle.id # type: ignore diff --git a/sdk/storage/azure-storage-file/azure/storage/file/aio/file_client_async.py b/sdk/storage/azure-storage-file/azure/storage/file/aio/file_client_async.py index eb9eef4dcc68..ee90b5b3b707 100644 --- a/sdk/storage/azure-storage-file/azure/storage/file/aio/file_client_async.py +++ b/sdk/storage/azure-storage-file/azure/storage/file/aio/file_client_async.py @@ -879,17 +879,14 @@ async def close_handles( # type: (...) -> Any """Close open file handles. - This operation may not finish with a single call, so a long-running poller - is returned that can be used to wait until the operation is complete. - :param handle: Optionally, a specific handle to close. The default value is '*' which will attempt to close all open handles. :type handle: str or ~azure.storage.file.Handle :param int timeout: The timeout parameter is expressed in seconds. - :returns: A long-running poller to get operation status. - :rtype: ~azure.core.polling.LROPoller + :returns: The number of file handles that were closed. + :rtype: int """ try: handle_id = handle.id # type: ignore From 93b99abc966925ef13a0f473ca70b00d86edffac Mon Sep 17 00:00:00 2001 From: Krista Pratico Date: Mon, 14 Oct 2019 13:43:08 -0700 Subject: [PATCH 3/3] fix type hints --- .../azure/storage/file/aio/directory_client_async.py | 2 +- .../azure/storage/file/aio/file_client_async.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/storage/azure-storage-file/azure/storage/file/aio/directory_client_async.py b/sdk/storage/azure-storage-file/azure/storage/file/aio/directory_client_async.py index 2154dacf9499..059d42d9f33e 100644 --- a/sdk/storage/azure-storage-file/azure/storage/file/aio/directory_client_async.py +++ b/sdk/storage/azure-storage-file/azure/storage/file/aio/directory_client_async.py @@ -265,7 +265,7 @@ async def close_handles( timeout=None, # type: Optional[int] **kwargs # type: Any ): - # type: (...) -> Any + # type: (...) -> int """Close open file handles. :param handle: diff --git a/sdk/storage/azure-storage-file/azure/storage/file/aio/file_client_async.py b/sdk/storage/azure-storage-file/azure/storage/file/aio/file_client_async.py index ee90b5b3b707..29bd299d3dcf 100644 --- a/sdk/storage/azure-storage-file/azure/storage/file/aio/file_client_async.py +++ b/sdk/storage/azure-storage-file/azure/storage/file/aio/file_client_async.py @@ -876,7 +876,7 @@ async def close_handles( timeout=None, # type: Optional[int] **kwargs # type: Any ): - # type: (...) -> Any + # type: (...) -> int """Close open file handles. :param handle: