From 4c018c4edc012b86c9b9739159089811e5bac60b Mon Sep 17 00:00:00 2001 From: xiafu Date: Wed, 27 May 2020 15:47:02 -0700 Subject: [PATCH] address comments --- .../storage/filedatalake/_data_lake_file_client.py | 11 +++++++---- .../filedatalake/aio/_data_lake_file_client_async.py | 11 +++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) 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 488dffb0f023..eb7b5ae99da8 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 @@ -241,15 +241,18 @@ def get_file_properties(self, **kwargs): """ return self._get_path_properties(cls=FileProperties._deserialize_file_properties, **kwargs) # pylint: disable=protected-access - def set_file_expiry(self, expiry_options, expires_on=None, **kwargs): - # type: (**Any) -> None + def set_file_expiry(self, expiry_options, # type: str + expires_on=None, # type: Optional[Union[datetime, int]] + **kwargs): + # type: (str, Optional[Union[datetime, int]], **Any) -> None """Sets the time a file will expire and be deleted. :param str expiry_options: Required. Indicates mode of the expiry time. Possible values include: 'NeverExpire', 'RelativeToCreation', 'RelativeToNow', 'Absolute' - :param datetime expires_on: - The time to set the file to expiry + :param datetime or int expires_on: + The time to set the file to expiry. + When expiry_options is RelativeTo*, expires_on should be an int in milliseconds :keyword int timeout: The timeout parameter is expressed in seconds. :rtype: None 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 c389805bd333..33d92ab5cf49 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 @@ -204,15 +204,18 @@ async def get_file_properties(self, **kwargs): """ return await self._get_path_properties(cls=FileProperties._deserialize_file_properties, **kwargs) # pylint: disable=protected-access - async def set_file_expiry(self, expiry_options, expires_on=None, **kwargs): - # type: (**Any) -> None + async def set_file_expiry(self, expiry_options, # type: str + expires_on=None, # type: Optional[Union[datetime, int]] + **kwargs): + # type: (str, Optional[Union[datetime, int]], **Any) -> None """Sets the time a file will expire and be deleted. :param str expiry_options: Required. Indicates mode of the expiry time. Possible values include: 'NeverExpire', 'RelativeToCreation', 'RelativeToNow', 'Absolute' - :param datetime expires_on: - The time to set the file to expiry + :param datetime or int expires_on: + The time to set the file to expiry. + When expiry_options is RelativeTo*, expires_on should be an int in milliseconds :keyword int timeout: The timeout parameter is expressed in seconds. :rtype: None