From 9138c955af8a3c77547532dbe8633720fcbcd8b6 Mon Sep 17 00:00:00 2001 From: Peter Wu <162184229+weirongw23-msft@users.noreply.github.com> Date: Sun, 21 Apr 2024 09:14:00 -0400 Subject: [PATCH] [Storage] [Datalake] Fixed next pylint errors in datalake storage (#35167) --- .../_data_lake_directory_client.py | 20 +++++++++++----- .../filedatalake/_data_lake_file_client.py | 24 ++++++++++++------- .../filedatalake/_data_lake_service_client.py | 5 +++- .../filedatalake/_file_system_client.py | 19 +++++++++------ .../storage/filedatalake/_path_client.py | 17 +++++++++---- .../storage/filedatalake/_shared/policies.py | 7 +++--- .../aio/_data_lake_directory_client_async.py | 18 ++++++++++---- .../aio/_data_lake_file_client_async.py | 23 ++++++++++++------ .../aio/_data_lake_service_client_async.py | 5 +++- .../aio/_file_system_client_async.py | 20 ++++++++++------ .../filedatalake/aio/_path_client_async.py | 12 ++++++++-- 11 files changed, 117 insertions(+), 53 deletions(-) diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_directory_client.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_directory_client.py index dfb4071a2636..28eba4492e94 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_directory_client.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_directory_client.py @@ -244,7 +244,8 @@ def delete_directory(self, **kwargs): This value is not tracked or validated on the client. To configure client-side network timesouts see `here `_. - :return: None + :returns: None. + :rtype: None .. admonition:: Example: @@ -303,7 +304,10 @@ def get_directory_properties(self, **kwargs): This value is not tracked or validated on the client. To configure client-side network timesouts see `here `_. - :rtype: DirectoryProperties + :returns: + DirectoryProperties with all user-defined metadata, standard HTTP properties, + and system properties for the directory. It does not return the content of the directory. + :rtype: ~azure.storage.filedatalake.DirectoryProperties .. admonition:: Example: @@ -396,7 +400,8 @@ def rename_directory(self, new_name, **kwargs): This value is not tracked or validated on the client. To configure client-side network timesouts see `here `_. - :return: DataLakeDirectoryClient + :returns: A DataLakeDirectoryClient with the renamed directory. + :rtype: ~azure.storage.filedatalake.DataLakeDirectoryClient .. admonition:: Example: @@ -496,7 +501,8 @@ def create_sub_directory(self, sub_directory, # type: Union[DirectoryProperties This value is not tracked or validated on the client. To configure client-side network timesouts see `here `_. - :return: DataLakeDirectoryClient for the subdirectory. + :returns: DataLakeDirectoryClient for the subdirectory. + :rtype: ~azure.storage.filedatalake.DataLakeDirectoryClient """ subdir = self.get_sub_directory_client(sub_directory) subdir.create_directory(metadata=metadata, **kwargs) @@ -540,7 +546,8 @@ def delete_sub_directory(self, sub_directory, # type: Union[DirectoryProperties This value is not tracked or validated on the client. To configure client-side network timesouts see `here `_. - :return: DataLakeDirectoryClient for the subdirectory + :returns: DataLakeDirectoryClient for the subdirectory. + :rtype: ~azure.storage.filedatalake.DataLakeDirectoryClient """ subdir = self.get_sub_directory_client(sub_directory) subdir.delete_directory(**kwargs) @@ -632,7 +639,8 @@ def create_file(self, file, # type: Union[FileProperties, str] This value is not tracked or validated on the client. To configure client-side network timesouts see `here `_. - :return: DataLakeFileClient + :returns: A DataLakeFileClient with newly created file. + :rtype: ~azure.storage.filedatalake.DataLakeFileClient """ file_client = self.get_file_client(file) file_client.create_file(**kwargs) diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_file_client.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_file_client.py index 5f5df8a25584..e14d66afb497 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_file_client.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_file_client.py @@ -213,9 +213,10 @@ def create_file(self, content_settings=None, # type: Optional[ContentSettings] This value is not tracked or validated on the client. To configure client-side network timesouts see `here `_. - :return: response dict (Etag and last modified). :keyword str encryption_context: Specifies the encryption context to set on the file. + :returns: response dict (Etag and last modified). + :rtype: dict[str, str] or dict[str, ~datetime.datetime] .. admonition:: Example: @@ -261,7 +262,8 @@ def delete_file(self, **kwargs): This value is not tracked or validated on the client. To configure client-side network timesouts see `here `_. - :return: None + :returns: None. + :rtype: None .. admonition:: Example: @@ -426,6 +428,7 @@ def upload_data( Upload data to a file. :param data: Content to be uploaded to file + :type data: bytes, str, Iterable[AnyStr], or IO[AnyStr] :param int length: Size of the data in bytes. :param bool overwrite: to overwrite an existing file or not. :keyword ~azure.storage.filedatalake.ContentSettings content_settings: @@ -490,7 +493,8 @@ def upload_data( Defaults to 100*1024*1024, or 100MB. :keyword str encryption_context: Specifies the encryption context to set on the file. - :return: response dict (Etag and last modified). + :returns: response dict (Etag and last modified). + :rtype: dict[str, Any] """ options = self._upload_options( data, @@ -541,8 +545,10 @@ def append_data(self, data, # type: Union[bytes, str, Iterable[AnyStr], IO[AnyS """Append data to the file. :param data: Content to be appended to file - :param offset: start position of the data to be appended to. + :type data: bytes, str, Iterable[AnyStr], or IO[AnyStr] + :param int offset: start position of the data to be appended to. :param length: Size of the data in bytes. + :type length: int or None :keyword bool flush: If true, will commit the data after it is appended. :keyword bool validate_content: @@ -576,7 +582,8 @@ def append_data(self, data, # type: Union[bytes, str, Iterable[AnyStr], IO[AnyS :keyword ~azure.storage.filedatalake.CustomerProvidedEncryptionKey cpk: Encrypts the data on the service-side with the given key. Use of customer-provided keys must be done over HTTPS. - :return: dict of the response header + :returns: dict of the response header. + :rtype: dict[str, str], dict[str, ~datetime.datetime], or dict[str, int] .. admonition:: Example: @@ -637,8 +644,8 @@ def flush_data(self, offset, # type: int # type: (...) -> Dict[str, Union[str, datetime]] """ Commit the previous appended data. - :param offset: offset is equal to the length of the file after commit the - previous appended data. + :param int offset: offset is equal to the length of the file after commit + the previous appended data. :param bool retain_uncommitted_data: Valid only for flush operations. If "true", uncommitted data is retained after the flush operation completes; otherwise, the uncommitted data is deleted after the flush @@ -703,7 +710,8 @@ def flush_data(self, offset, # type: int :keyword ~azure.storage.filedatalake.CustomerProvidedEncryptionKey cpk: Encrypts the data on the service-side with the given key. Use of customer-provided keys must be done over HTTPS. - :return: response header in dict + :returns: response header in dict + :rtype: dict[str, str] or dict[str, ~datetime.datetime] .. admonition:: Example: diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_service_client.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_service_client.py index e22fee3ffdf2..6112bbfc1424 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_service_client.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_service_client.py @@ -294,6 +294,7 @@ def create_file_system(self, file_system, # type: Union[FileSystemProperties, s This value is not tracked or validated on the client. To configure client-side network timesouts see `here `_. + :returns: A FileSystemClient with newly created file system. :rtype: ~azure.storage.filedatalake.FileSystemClient .. admonition:: Example: @@ -329,6 +330,7 @@ def _rename_file_system(self, name, new_name, **kwargs): This value is not tracked or validated on the client. To configure client-side network timesouts see `here `_. + :returns: A FileSystemClient with the specified file system renamed. :rtype: ~azure.storage.filedatalake.FileSystemClient """ self._blob_service_client._rename_container(name, new_name, **kwargs) # pylint: disable=protected-access @@ -406,7 +408,8 @@ def delete_file_system(self, file_system, # type: Union[FileSystemProperties, s This value is not tracked or validated on the client. To configure client-side network timesouts see `here `_. - :rtype: None + :returns: A FileSystemClient with the specified file system deleted. + :rtype: ~azure.storage.filedatalake.FileSystemClient .. admonition:: Example: diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_file_system_client.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_file_system_client.py index b85926a2d7c0..c5f9e53dabfa 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_file_system_client.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_file_system_client.py @@ -331,6 +331,7 @@ def _rename_file_system(self, new_name, **kwargs): This value is not tracked or validated on the client. To configure client-side network timesouts see `here `_. + :returns: FileSystemClient with renamed properties. :rtype: ~azure.storage.filedatalake.FileSystemClient """ self._container_client._rename_container(new_name, **kwargs) # pylint: disable=protected-access @@ -674,7 +675,8 @@ def create_directory(self, directory, # type: Union[DirectoryProperties, str] This value is not tracked or validated on the client. To configure client-side network timesouts see `here `_. - :return: DataLakeDirectoryClient + :returns: DataLakeDirectoryClient with new directory and metadata. + :rtype: ~azure.storage.file.datalake.DataLakeDirectoryClient .. admonition:: Example: @@ -727,7 +729,8 @@ def delete_directory(self, directory, # type: Union[DirectoryProperties, str] This value is not tracked or validated on the client. To configure client-side network timesouts see `here `_. - :return: DataLakeDirectoryClient + :returns: DataLakeDirectoryClient after deleting specified directory. + :rtype: ~azure.storage.file.datalake.DataLakeDirectoryClient .. admonition:: Example: @@ -753,11 +756,11 @@ def create_file(self, file, # type: Union[FileProperties, str] The file with which to interact. This can either be the name of the file, or an instance of FileProperties. :type file: str or ~azure.storage.filedatalake.FileProperties - :param ~azure.storage.filedatalake.ContentSettings content_settings: + :keyword ~azure.storage.filedatalake.ContentSettings content_settings: ContentSettings object used to set path properties. - :param metadata: + :keyword metadata: Name-value pairs associated with the file as metadata. - :type metadata: dict(str, str) + :paramtype metadata: dict[str, str] :keyword lease: Required if the file has an active lease. Value can be a DataLakeLeaseClient object or the lease ID as a string. @@ -825,7 +828,8 @@ def create_file(self, file, # type: Union[FileProperties, str] This value is not tracked or validated on the client. To configure client-side network timesouts see `here `_. - :return: DataLakeFileClient + :returns: DataLakeFileClient with new file created. + :rtype: ~azure.storage.file.datalake.DataLakeFileClient .. admonition:: Example: @@ -878,7 +882,8 @@ def delete_file(self, file, # type: Union[FileProperties, str] This value is not tracked or validated on the client. To configure client-side network timesouts see `here `_. - :return: DataLakeFileClient + :return: DataLakeFileClient after deleting specified file. + :rtype: azure.storage.file.datalake.DataLakeFileClient .. admonition:: Example: diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_path_client.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_path_client.py index 11891ffc8e47..15432b2e62e2 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_path_client.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_path_client.py @@ -449,7 +449,8 @@ def set_access_control(self, owner=None, # type: Optional[str] This value is not tracked or validated on the client. To configure client-side network timesouts see `here `_. - :keyword: response dict (Etag and last modified). + :returns: response dict containing access control options (Etag and last modified). + :rtype: dict[str, str] or dict[str, ~datetime.datetime] """ if not any([owner, group, permissions, acl]): raise ValueError("At least one parameter should be set for set_access_control API") @@ -519,7 +520,8 @@ def get_access_control(self, upn=None, # type: Optional[bool] This value is not tracked or validated on the client. To configure client-side network timesouts see `here `_. - :keyword: response dict. + :returns: response dict containing access control options with no modifications. + :rtype: dict[str, Any] """ options = self._get_access_control_options(upn=upn, **kwargs) try: @@ -583,7 +585,7 @@ def set_access_control_recursive(self, acl, **kwargs): #other-client--per-operation-configuration>`_. :return: A summary of the recursive operations, including the count of successes and failures, as well as a continuation token in case the operation was terminated prematurely. - :rtype: :class:`~azure.storage.filedatalake.AccessControlChangeResult` + :rtype: ~azure.storage.filedatalake.AccessControlChangeResult :raises ~azure.core.exceptions.AzureError: User can restart the operation using continuation_token field of AzureError if the token is available. """ @@ -637,7 +639,7 @@ def update_access_control_recursive(self, acl, **kwargs): #other-client--per-operation-configuration>`_. :return: A summary of the recursive operations, including the count of successes and failures, as well as a continuation token in case the operation was terminated prematurely. - :rtype: :class:`~azure.storage.filedatalake.AccessControlChangeResult` + :rtype: ~azure.storage.filedatalake.AccessControlChangeResult :raises ~azure.core.exceptions.AzureError: User can restart the operation using continuation_token field of AzureError if the token is available. """ @@ -690,7 +692,7 @@ def remove_access_control_recursive(self, acl, **kwargs): #other-client--per-operation-configuration>`_. :return: A summary of the recursive operations, including the count of successes and failures, as well as a continuation token in case the operation was terminated prematurely. - :rtype: :class:`~azure.storage.filedatalake.AccessControlChangeResult` + :rtype: ~azure.storage.filedatalake.AccessControlChangeResult :raises ~azure.core.exceptions.AzureError: User can restart the operation using continuation_token field of AzureError if the token is available. """ @@ -879,6 +881,8 @@ def _rename_path(self, rename_source, **kwargs): This value is not tracked or validated on the client. To configure client-side network timesouts see `here `_. + :returns: response dict containing information about the renamed path. + :rtype: dict[str, Any] """ options = self._rename_path_options( rename_source, @@ -933,6 +937,9 @@ def _get_path_properties(self, **kwargs): This value is not tracked or validated on the client. To configure client-side network timesouts see `here `_. + :returns: + Information including user-defined metadata, standard HTTP properties, + and system properties for the file or directory. :rtype: DirectoryProperties or FileProperties .. admonition:: Example: diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/policies.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/policies.py index 4abfc9163a84..2aa1ab8097ea 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/policies.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/policies.py @@ -12,7 +12,7 @@ import uuid from io import SEEK_SET, UnsupportedOperation from time import time -from typing import Any, Dict, Optional, TYPE_CHECKING, Union +from typing import Any, Dict, Optional, TYPE_CHECKING from urllib.parse import ( parse_qsl, urlencode, @@ -411,9 +411,8 @@ def _set_next_host_location(self, settings: Dict[str, Any], request: "PipelineRe """ A function which sets the next host location on the request, if applicable. - :param dict[str, Any]] settings: The configurable values pertaining to the next host location. - :param request: A pipeline request object. - :type request: ~azure.core.pipeline.PipelineRequest + :param Dict[str, Any]] settings: The configurable values pertaining to the next host location. + :param PipelineRequest request: A pipeline request object. """ if settings['hosts'] and all(settings['hosts'].values()): url = urlparse(request.url) diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_data_lake_directory_client_async.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_data_lake_directory_client_async.py index 648a354c6eb3..de27bb4078c3 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_data_lake_directory_client_async.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_data_lake_directory_client_async.py @@ -221,7 +221,8 @@ async def delete_directory(self, **kwargs): This value is not tracked or validated on the client. To configure client-side network timesouts see `here `_. - :return: None + :returns: None. + :rtype: None .. admonition:: Example: @@ -280,6 +281,9 @@ async def get_directory_properties(self, **kwargs): This value is not tracked or validated on the client. To configure client-side network timesouts see `here `_. + :returns: + Information including user-defined metadata, standard HTTP properties, + and system properties for the file or directory. :rtype: DirectoryProperties .. admonition:: Example: @@ -357,7 +361,8 @@ async def rename_directory(self, new_name, # type: str This value is not tracked or validated on the client. To configure client-side network timesouts see `here `_. - :return: DataLakeDirectoryClient + :returns: DataLakeDirectoryClient containing the renamed directory. + :rtype: ~azure.storage.filedatalake.aio.DataLakeDirectoryClient .. admonition:: Example: @@ -457,7 +462,8 @@ async def create_sub_directory(self, sub_directory, # type: Union[DirectoryProp This value is not tracked or validated on the client. To configure client-side network timesouts see `here `_. - :return: DataLakeDirectoryClient for the subdirectory. + :returns: DataLakeDirectoryClient for the subdirectory. + :rtype: ~azure.storage.filedatalake.aio.DataLakeDirectoryClient """ subdir = self.get_sub_directory_client(sub_directory) await subdir.create_directory(metadata=metadata, **kwargs) @@ -501,7 +507,8 @@ async def delete_sub_directory(self, sub_directory, # type: Union[DirectoryProp This value is not tracked or validated on the client. To configure client-side network timesouts see `here `_. - :return: DataLakeDirectoryClient for the subdirectory + :returns: DataLakeDirectoryClient for the subdirectory. + :rtype: ~azure.storage.filedatalake.aio.DataLakeDirectoryClient """ subdir = self.get_sub_directory_client(sub_directory) await subdir.delete_directory(**kwargs) @@ -593,7 +600,8 @@ async def create_file(self, file, # type: Union[FileProperties, str] This value is not tracked or validated on the client. To configure client-side network timesouts see `here `_. - :return: DataLakeFileClient + :returns: DataLakeFileClient with the new file. + :rtype: ~azure.storage.filedatalake.aio.DataLakeDirectoryClient """ file_client = self.get_file_client(file) await file_client.create_file(**kwargs) diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_data_lake_file_client_async.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_data_lake_file_client_async.py index b318f534b2e6..607b33059ee6 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_data_lake_file_client_async.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_data_lake_file_client_async.py @@ -165,7 +165,8 @@ async def create_file(self, content_settings=None, # type: Optional[ContentSett #other-client--per-operation-configuration>`_. :keyword str encryption_context: Specifies the encryption context to set on the file. - :return: response dict (Etag and last modified). + :returns: response dict (Etag and last modified). + :rtype: dict[str, str] or dict[~datetime.datetime] .. admonition:: Example: @@ -228,7 +229,8 @@ async def delete_file(self, **kwargs): This value is not tracked or validated on the client. To configure client-side network timesouts see `here `_. - :return: None + :returns: None. + :rtype: None .. admonition:: Example: @@ -287,6 +289,7 @@ async def get_file_properties(self, **kwargs): This value is not tracked or validated on the client. To configure client-side network timesouts see `here `_. + :returns: All user-defined metadata, standard HTTP properties, and system properties for the file. :rtype: FileProperties .. admonition:: Example: @@ -339,13 +342,14 @@ async def upload_data( Upload data to a file. :param data: Content to be uploaded to file + :type data: bytes, str, Iterable[AnyStr], AsyncIterable[AnyStr], or IO[AnyStr] :param int length: Size of the data in bytes. :param bool overwrite: to overwrite an existing file or not. :keyword ~azure.storage.filedatalake.ContentSettings content_settings: ContentSettings object used to set path properties. :keyword metadata: Name-value pairs associated with the blob as metadata. - :paramtype metadata: Optional[dict[str, str]] + :paramtype metadata: dict[str, str] or None :keyword ~azure.storage.filedatalake.DataLakeLeaseClient or str lease: Required if the blob has an active lease. Value can be a DataLakeLeaseClient object or the lease ID as a string. @@ -404,6 +408,7 @@ async def upload_data( :keyword str encryption_context: Specifies the encryption context to set on the file. :return: response dict (Etag and last modified). + :rtype: dict[str, Any] """ options = self._upload_options( data, @@ -421,8 +426,10 @@ async def append_data(self, data, # type: Union[bytes, str, Iterable[AnyStr], I """Append data to the file. :param data: Content to be appended to file - :param offset: start position of the data to be appended to. + :type data: bytes, str, Iterable[AnyStr], or IO[AnyStr] + :param int offset: start position of the data to be appended to. :param length: Size of the data in bytes. + :type length: int or None :keyword bool flush: If true, will commit the data after it is appended. :keyword bool validate_content: @@ -456,7 +463,8 @@ async def append_data(self, data, # type: Union[bytes, str, Iterable[AnyStr], I :keyword ~azure.storage.filedatalake.CustomerProvidedEncryptionKey cpk: Encrypts the data on the service-side with the given key. Use of customer-provided keys must be done over HTTPS. - :return: dict of the response header + :returns: dict of the response header. + :rtype: dict[str, str], dict[str, ~datetime.datetime], or dict[str, int] .. admonition:: Example: @@ -485,7 +493,7 @@ async def flush_data(self, offset, # type: int # type: (...) -> Dict[str, Union[str, datetime]] """ Commit the previous appended data. - :param offset: offset is equal to the length of the file after commit the + :param int offset: offset is equal to the length of the file after commit the previous appended data. :param bool retain_uncommitted_data: Valid only for flush operations. If "true", uncommitted data is retained after the flush operation @@ -551,7 +559,8 @@ async def flush_data(self, offset, # type: int :keyword ~azure.storage.filedatalake.CustomerProvidedEncryptionKey cpk: Encrypts the data on the service-side with the given key. Use of customer-provided keys must be done over HTTPS. - :return: response header in dict + :returns: response header in dict. + :rtype: dict[str, str] or dict[str, ~datetime.datetime] .. admonition:: Example: diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_data_lake_service_client_async.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_data_lake_service_client_async.py index 51012d78a298..0b0adedbe0b3 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_data_lake_service_client_async.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_data_lake_service_client_async.py @@ -234,6 +234,7 @@ async def create_file_system(self, file_system, # type: Union[FileSystemPropert This value is not tracked or validated on the client. To configure client-side network timesouts see `here `_. + :returns: FileSystemClient under the specified account. :rtype: ~azure.storage.filedatalake.FileSystemClient .. admonition:: Example: @@ -269,6 +270,7 @@ async def _rename_file_system(self, name, new_name, **kwargs): This value is not tracked or validated on the client. To configure client-side network timesouts see `here `_. + :returns: FileSystemClient with the newly specified name. :rtype: ~azure.storage.filedatalake.FileSystemClient """ await self._blob_service_client._rename_container(name, new_name, **kwargs) # pylint: disable=protected-access @@ -345,7 +347,8 @@ async def delete_file_system(self, file_system, # type: Union[FileSystemPropert This value is not tracked or validated on the client. To configure client-side network timesouts see `here `_. - :rtype: None + :returns: FileSystemClient after marking the specified file system for deletion. + :rtype: ~azure.storage.filedatalake.aio.FileSystemClient .. admonition:: Example: diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_file_system_client_async.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_file_system_client_async.py index fb7934463a50..b8d35a251b41 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_file_system_client_async.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_file_system_client_async.py @@ -271,6 +271,7 @@ async def _rename_file_system(self, new_name, **kwargs): This value is not tracked or validated on the client. To configure client-side network timesouts see `here `_. + :returns: FileSystemClient with renamed properties. :rtype: ~azure.storage.filedatalake.FileSystemClient """ await self._container_client._rename_container(new_name, **kwargs) # pylint: disable=protected-access @@ -403,6 +404,7 @@ async def set_file_system_metadata( # type: ignore see `here `_. :returns: file system-updated property dict (Etag and last modified). + :rtype: dict[str, str] or dict[str, ~datetime.datetime] .. admonition:: Example: @@ -616,7 +618,8 @@ async def create_directory(self, directory, # type: Union[DirectoryProperties, This value is not tracked or validated on the client. To configure client-side network timesouts see `here `_. - :return: DataLakeDirectoryClient + :returns: DataLakeDirectoryClient with new directory and metadata. + :rtype: ~azure.storage.file.datalake.aio.DataLakeDirectoryClient .. admonition:: Example: @@ -669,7 +672,8 @@ async def delete_directory(self, directory, # type: Union[DirectoryProperties, This value is not tracked or validated on the client. To configure client-side network timesouts see `here `_. - :return: DataLakeDirectoryClient + :returns: DataLakeDirectoryClient after deleting specified directory. + :rtype: ~azure.storage.file.datalake.aio.DataLakeDirectoryClient .. admonition:: Example: @@ -695,11 +699,11 @@ async def create_file(self, file, # type: Union[FileProperties, str] The file with which to interact. This can either be the name of the file, or an instance of FileProperties. :type file: str or ~azure.storage.filedatalake.FileProperties - :param ~azure.storage.filedatalake.ContentSettings content_settings: + :keyword ~azure.storage.filedatalake.ContentSettings content_settings: ContentSettings object used to set path properties. - :param metadata: + :keyword metadata: Name-value pairs associated with the file as metadata. - :type metadata: dict(str, str) + :paramtype metadata: dict[str, str] :keyword lease: Required if the file has an active lease. Value can be a DataLakeLeaseClient object or the lease ID as a string. @@ -767,7 +771,8 @@ async def create_file(self, file, # type: Union[FileProperties, str] This value is not tracked or validated on the client. To configure client-side network timesouts see `here `_. - :return: DataLakeFileClient + :returns: DataLakeFileClient with new file created. + :rtype: ~azure.storage.file.datalake.aio.DataLakeFileClient .. admonition:: Example: @@ -820,7 +825,8 @@ async def delete_file(self, file, # type: Union[FileProperties, str] This value is not tracked or validated on the client. To configure client-side network timesouts see `here `_. - :return: DataLakeFileClient + :return: DataLakeFileClient after deleting specified file. + :rtype: ~azure.storage.file.datalake.aio.DataLakeFileClient .. literalinclude:: ../samples/datalake_samples_file_system_async.py :start-after: [START delete_file_from_file_system] diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_path_client_async.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_path_client_async.py index 82541e8d5526..6ebce0ec16c3 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_path_client_async.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_path_client_async.py @@ -325,7 +325,8 @@ async def set_access_control(self, owner=None, # type: Optional[str] This value is not tracked or validated on the client. To configure client-side network timesouts see `here `_. - :keyword: response dict (Etag and last modified). + :returns: dict containing access control options after setting modifications (Etag and last modified). + :rtype: dict[str, str] or dict[str, ~datetime.datetime] """ options = self._set_access_control_options(owner=owner, group=group, permissions=permissions, acl=acl, **kwargs) try: @@ -377,7 +378,8 @@ async def get_access_control(self, upn=None, # type: Optional[bool] This value is not tracked or validated on the client. To configure client-side network timesouts see `here `_. - :keyword: response dict. + :returns: response dict containing access control options (Etag and last modified). + :rtype: dict[str, str] or dict[str, ~datetime.datetime] """ options = self._get_access_control_options(upn=upn, **kwargs) try: @@ -668,6 +670,8 @@ async def _rename_path(self, rename_source, **kwargs): This value is not tracked or validated on the client. To configure client-side network timesouts see `here `_. + :returns: response dict containing information about the renamed path. + :rtype: dict[str, Any] """ options = self._rename_path_options( rename_source, @@ -722,6 +726,9 @@ async def _get_path_properties(self, **kwargs): This value is not tracked or validated on the client. To configure client-side network timesouts see `here `_. + :returns: + Information including user-defined metadata, standard HTTP properties, + and system properties for the file or directory. :rtype: DirectoryProperties or FileProperties """ upn = kwargs.pop('upn', None) @@ -792,6 +799,7 @@ async def set_metadata(self, metadata, # type: Dict[str, str] see `here `_. :returns: file system-updated property dict (Etag and last modified). + :rtype: dict[str, str] or dict[str, ~datetime.datetime] """ return await self._blob_client.set_blob_metadata(metadata=metadata, **kwargs)