-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Datalake] Removed list_paths manual paging and deserialization #16309
Changes from all commits
8f6fe73
e8bb431
ee2303b
8253da8
4cdb786
b73839c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,6 @@ | |
# -------------------------------------------------------------------------- | ||
# pylint: disable=invalid-overridden-method | ||
|
||
import functools | ||
from typing import ( # pylint: disable=unused-import | ||
Union, Optional, Any, Dict, TYPE_CHECKING | ||
) | ||
|
@@ -21,8 +20,8 @@ | |
|
||
from ._data_lake_file_client_async import DataLakeFileClient | ||
from ._data_lake_directory_client_async import DataLakeDirectoryClient | ||
from ._models import PathPropertiesPaged | ||
from ._data_lake_lease_async import DataLakeLeaseClient | ||
from .._deserialize import deserialize_path_properties | ||
from .._file_system_client import FileSystemClient as FileSystemClientBase | ||
from .._generated.aio import AzureDataLakeStorageRESTAPI | ||
from .._shared.base_client_async import AsyncTransportWrapper, AsyncStorageAccountHostsMixin | ||
|
@@ -385,7 +384,7 @@ def get_paths(self, path=None, # type: Optional[str] | |
recursive=True, # type: Optional[bool] | ||
max_results=None, # type: Optional[int] | ||
**kwargs): | ||
# type: (...) -> ItemPaged[PathProperties] | ||
# type: (...) -> AsyncItemPaged[PathProperties] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. isn't this a break? what if somebody checks type? should we alias? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have previously fixed incorrect type annotations. The return object in this method is |
||
"""Returns a generator to list the paths(could be files or directories) under the specified file system. | ||
The generator will lazily follow the continuation tokens returned by | ||
the service. | ||
|
@@ -421,14 +420,13 @@ def get_paths(self, path=None, # type: Optional[str] | |
:caption: List the blobs in the file system. | ||
""" | ||
timeout = kwargs.pop('timeout', None) | ||
command = functools.partial( | ||
self._client.file_system.list_paths, | ||
return self._client.file_system.list_paths( | ||
recursive=recursive, | ||
max_results=max_results, | ||
path=path, | ||
timeout=timeout, | ||
cls=deserialize_path_properties, | ||
**kwargs) | ||
return AsyncItemPaged( | ||
command, recursive, path=path, max_results=max_results, | ||
page_iterator_class=PathPropertiesPaged, **kwargs) | ||
|
||
@distributed_trace_async | ||
async def create_directory(self, directory, # type: Union[DirectoryProperties, str] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this in an attempt to resolve the flaky test
test_create_largest_blob_from_stream_single_upload_without_network
which seems to sometimes do aPUT
twice rather than once causing one of the assertions to fail.