Skip to content

Commit a1987ab

Browse files
[Storage] Data Lake Typing and API View Feedback (#40096)
1 parent e5eec3a commit a1987ab

File tree

12 files changed

+30
-28
lines changed

12 files changed

+30
-28
lines changed

sdk/storage/azure-storage-blob/CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# Release History
22

3-
## 12.26.0b1 (Unreleased)
3+
## 12.25.1 (Unreleased)
44

5-
### Features Added
5+
### Other Changes
6+
- Updated dependency for `azure-storage-file-datalake` type hints.
67

78
## 12.25.0 (2025-03-11)
89

sdk/storage/azure-storage-blob/azure/storage/blob/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
# license information.
55
# --------------------------------------------------------------------------
66

7-
VERSION = "12.26.0b1"
7+
VERSION = "12.25.1"

sdk/storage/azure-storage-blob/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
url='https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-blob',
5757
keywords="azure, azure sdk",
5858
classifiers=[
59-
'Development Status :: 4 - Beta',
59+
'Development Status :: 5 - Production/Stable',
6060
'Programming Language :: Python',
6161
'Programming Language :: Python :: 3 :: Only',
6262
'Programming Language :: Python :: 3',

sdk/storage/azure-storage-file-datalake/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# Release History
22

3-
## 12.20.0b1 (Unreleased)
3+
## 12.20.0 (Unreleased)
44

55
### Features Added
6+
- Updated type hints across the entire package and enabled MyPy to run during CI. Some public types may have been adjusted if they were previously erroneous or incomplete.
67

78
## 12.19.0 (2025-03-11)
89

sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_directory_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def create_directory(
227227
return self._create('directory', metadata=metadata, **kwargs)
228228

229229
@distributed_trace
230-
def delete_directory(self, **kwargs: Any) -> Dict[str, Any]: # pylint: disable=delete-operation-wrong-return-type
230+
def delete_directory(self, **kwargs: Any) -> None:
231231
"""
232232
Marks the specified directory for deletion.
233233
@@ -270,7 +270,7 @@ def delete_directory(self, **kwargs: Any) -> Dict[str, Any]: # pylint: disable=
270270
:dedent: 4
271271
:caption: Delete directory.
272272
"""
273-
return self._delete(recursive=True, **kwargs)
273+
return self._delete(recursive=True, **kwargs) # type: ignore [return-value]
274274

275275
@distributed_trace
276276
def get_directory_properties(self, **kwargs: Any) -> DirectoryProperties:

sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_file_client.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
from datetime import datetime
99
from typing import (
10-
Any, AnyStr, AsyncIterable, cast, Dict, IO, Iterable, Optional, Union,
10+
Any, AnyStr, cast, Dict, IO, Iterable, Optional, Union,
1111
TYPE_CHECKING
1212
)
1313
from urllib.parse import quote, unquote
@@ -240,7 +240,7 @@ def create_file(
240240
return self._create('file', content_settings=content_settings, metadata=metadata, **kwargs)
241241

242242
@distributed_trace
243-
def delete_file(self, **kwargs: Any) -> Dict[str, Any]: # pylint: disable=delete-operation-wrong-return-type
243+
def delete_file(self, **kwargs: Any) -> None:
244244
"""
245245
Marks the specified file for deletion.
246246
@@ -271,8 +271,8 @@ def delete_file(self, **kwargs: Any) -> Dict[str, Any]: # pylint: disable=delet
271271
This value is not tracked or validated on the client. To configure client-side network timesouts
272272
see `here <https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-file-datalake
273273
#other-client--per-operation-configuration>`_.
274-
:returns: A dictionary of response headers.
275-
:rtype: Dict[str, Any]
274+
:returns: A dictionary of response headers or None.
275+
:rtype: Dict[str, Any] or None
276276
277277
.. admonition:: Example:
278278
@@ -283,7 +283,7 @@ def delete_file(self, **kwargs: Any) -> Dict[str, Any]: # pylint: disable=delet
283283
:dedent: 4
284284
:caption: Delete file.
285285
"""
286-
return self._delete(**kwargs)
286+
return self._delete(**kwargs) # type: ignore [return-value]
287287

288288
@distributed_trace
289289
def get_file_properties(self, **kwargs: Any) -> FileProperties:
@@ -379,7 +379,7 @@ def set_file_expiry(
379379

380380
@distributed_trace
381381
def upload_data(
382-
self, data: Union[bytes, str, Iterable[AnyStr], AsyncIterable[AnyStr], IO[AnyStr]],
382+
self, data: Union[bytes, str, Iterable[AnyStr], IO[AnyStr]],
383383
length: Optional[int] = None,
384384
overwrite: Optional[bool] = False,
385385
**kwargs: Any
@@ -388,7 +388,7 @@ def upload_data(
388388
Upload data to a file.
389389
390390
:param data: Content to be uploaded to file
391-
:type data: bytes, str, Iterable[AnyStr], AsyncIterable[AnyStr], or IO[AnyStr]
391+
:type data: bytes, str, Iterable[AnyStr], or IO[AnyStr]
392392
:param int length: Size of the data in bytes.
393393
:param bool overwrite: to overwrite an existing file or not.
394394
:keyword ~azure.storage.filedatalake.ContentSettings content_settings:

sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_lease.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def __init__( # pylint: disable=missing-client-constructor-parameter-credential
6060
elif hasattr(client, '_container_client'):
6161
_client = client._container_client
6262
else:
63-
raise TypeError("Lease must use any of FileSystemClient DataLakeDirectoryClient, or DataLakeFileClient.")
63+
raise TypeError("Lease must use any of FileSystemClient, DataLakeDirectoryClient, or DataLakeFileClient.")
6464

6565
self._blob_lease_client = BlobLeaseClient(_client, lease_id=lease_id)
6666

sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
# license information.
55
# --------------------------------------------------------------------------
66

7-
VERSION = "12.20.0b1"
7+
VERSION = "12.20.0"

sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_data_lake_directory_client_async.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ async def exists(self, **kwargs: Any) -> bool:
248248
return await self._exists(**kwargs)
249249

250250
@distributed_trace_async
251-
async def delete_directory(self, **kwargs: Any) -> Dict[str, Any]:
251+
async def delete_directory(self, **kwargs: Any) -> None:
252252
"""
253253
Marks the specified directory for deletion.
254254
@@ -291,7 +291,7 @@ async def delete_directory(self, **kwargs: Any) -> Dict[str, Any]:
291291
:dedent: 4
292292
:caption: Delete directory.
293293
"""
294-
return await self._delete(recursive=True, **kwargs)
294+
return await self._delete(recursive=True, **kwargs) # type: ignore [return-value]
295295

296296
@distributed_trace_async
297297
async def get_directory_properties(self, **kwargs: Any) -> DirectoryProperties:

sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_data_lake_file_client_async.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
from datetime import datetime
99
from typing import (
10-
Any, AnyStr, AsyncIterable, cast, Dict, IO, Iterable, Optional, Union,
10+
Any, AnyStr, AsyncIterable, cast, Dict, IO, Optional, Union,
1111
TYPE_CHECKING
1212
)
1313
from urllib.parse import quote, unquote
@@ -256,7 +256,7 @@ async def exists(self, **kwargs: Any) -> bool:
256256
return await self._exists(**kwargs)
257257

258258
@distributed_trace_async
259-
async def delete_file(self, **kwargs: Any) -> Dict[str, Any]:
259+
async def delete_file(self, **kwargs: Any) -> None:
260260
"""
261261
Marks the specified file for deletion.
262262
@@ -299,7 +299,7 @@ async def delete_file(self, **kwargs: Any) -> Dict[str, Any]:
299299
:dedent: 4
300300
:caption: Delete file.
301301
"""
302-
return await self._delete(**kwargs)
302+
return await self._delete(**kwargs) # type: ignore [return-value]
303303

304304
@distributed_trace_async
305305
async def get_file_properties(self, **kwargs: Any) -> FileProperties:
@@ -395,7 +395,7 @@ async def set_file_expiry(
395395

396396
@distributed_trace_async
397397
async def upload_data(
398-
self, data: Union[bytes, str, Iterable[AnyStr], AsyncIterable[AnyStr], IO[AnyStr]],
398+
self, data: Union[bytes, str, AsyncIterable[AnyStr], IO[AnyStr]],
399399
length: Optional[int] = None,
400400
overwrite: Optional[bool] = False,
401401
**kwargs: Any
@@ -404,7 +404,7 @@ async def upload_data(
404404
Upload data to a file.
405405
406406
:param data: Content to be uploaded to file
407-
:type data: bytes, str, Iterable[AnyStr], AsyncIterable[AnyStr], or IO[AnyStr]
407+
:type data: bytes, str, AsyncIterable[AnyStr], or IO[AnyStr]
408408
:param int length: Size of the data in bytes.
409409
:param bool overwrite: to overwrite an existing file or not.
410410
:keyword ~azure.storage.filedatalake.ContentSettings content_settings:
@@ -489,15 +489,15 @@ async def upload_data(
489489

490490
@distributed_trace_async
491491
async def append_data(
492-
self, data: Union[bytes, str, Iterable[AnyStr], IO[AnyStr]],
492+
self, data: Union[bytes, str, AsyncIterable[AnyStr], IO[AnyStr]],
493493
offset: int,
494494
length: Optional[int] = None,
495495
**kwargs: Any
496496
) -> Dict[str, Any]:
497497
"""Append data to the file.
498498
499499
:param data: Content to be appended to file
500-
:type data: bytes, str, Iterable[AnyStr], or IO[AnyStr]
500+
:type data: bytes, str, AsyncIterable[AnyStr], or IO[AnyStr]
501501
:param int offset: start position of the data to be appended to.
502502
:param length: Size of the data in bytes.
503503
:type length: int or None

sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_data_lake_lease_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def __init__( # pylint: disable=missing-client-constructor-parameter-credential
6060
elif hasattr(client, '_container_client'):
6161
_client = client._container_client
6262
else:
63-
raise TypeError("Lease must use any of FileSystemClient DataLakeDirectoryClient, or DataLakeFileClient.")
63+
raise TypeError("Lease must use any of FileSystemClient, DataLakeDirectoryClient, or DataLakeFileClient.")
6464

6565
self._blob_lease_client = BlobLeaseClient(_client, lease_id=lease_id)
6666

sdk/storage/azure-storage-file-datalake/setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
url='https://github.com/Azure/azure-sdk-for-python',
5858
keywords="azure, azure sdk",
5959
classifiers=[
60-
'Development Status :: 4 - Beta',
60+
'Development Status :: 5 - Production/Stable',
6161
'Programming Language :: Python',
6262
'Programming Language :: Python :: 3 :: Only',
6363
'Programming Language :: Python :: 3',
@@ -78,7 +78,7 @@
7878
python_requires=">=3.8",
7979
install_requires=[
8080
"azure-core>=1.30.0",
81-
"azure-storage-blob>=12.26.0b1",
81+
"azure-storage-blob>=12.25.1",
8282
"typing-extensions>=4.6.0",
8383
"isodate>=0.6.1"
8484
],

0 commit comments

Comments
 (0)