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 @@ -265,12 +265,9 @@ async def close_handles(
timeout=None, # type: Optional[int]
**kwargs # type: Any
):
# type: (...) -> Any
# type: (...) -> int
"""Close open file handles.

This operation may not finish with a single call, so a long-running poller

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Change the type hint from Any to int

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.
Expand All @@ -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
Expand All @@ -301,7 +298,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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -876,20 +876,17 @@ async def close_handles(
timeout=None, # type: Optional[int]
**kwargs # type: Any
):
# type: (...) -> Any
# type: (...) -> int
"""Close open file handles.

This operation may not finish with a single call, so a long-running poller

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Change the type hint from Any to int

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
Expand All @@ -909,4 +906,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)