-
Couldn't load subscription status.
- Fork 3.2k
[Storage] Fix mypy regressions for Blob, Queue, File Share
#43610
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
base: main
Are you sure you want to change the base?
[Storage] Fix mypy regressions for Blob, Queue, File Share
#43610
Conversation
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.
Pull Request Overview
This PR fixes mypy regressions in the Azure Storage SDK by adding explicit type annotations for instance attributes across Blob, Queue, and File Share client classes.
Key changes:
- Added type annotations to client classes to satisfy
mypytype checking requirements - Added property access statements in sample code to ensure the annotated attributes are validated by
mypy
Reviewed Changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/storage/azure-storage-queue/azure/storage/queue/_queue_client.py | Added queue_name: str attribute annotation to QueueClient |
| sdk/storage/azure-storage-queue/azure/storage/queue/aio/_queue_client_async.py | Added queue_name: str attribute annotation to async QueueClient |
| sdk/storage/azure-storage-queue/samples/queue_samples_hello_world.py | Added property access to validate queue_name attribute |
| sdk/storage/azure-storage-queue/samples/queue_samples_hello_world_async.py | Added property access to validate queue_name attribute |
| sdk/storage/azure-storage-file-share/azure/storage/fileshare/_share_client.pyi | Added type annotations for share_name, allow_trailing_dot, allow_source_trailing_dot, and file_request_intent |
| sdk/storage/azure-storage-file-share/azure/storage/fileshare/_file_client.pyi | Added type annotations for share_name, file_name, file_path, directory_path, allow_trailing_dot, allow_source_trailing_dot, and file_request_intent |
| sdk/storage/azure-storage-file-share/azure/storage/fileshare/_directory_client.pyi | Added type annotations for share_name, directory_path, allow_trailing_dot, allow_source_trailing_dot, and file_request_intent |
| sdk/storage/azure-storage-file-share/azure/storage/fileshare/aio/_share_client_async.pyi | Added type annotations for share_name, allow_trailing_dot, allow_source_trailing_dot, and file_request_intent |
| sdk/storage/azure-storage-file-share/azure/storage/fileshare/aio/_file_client_async.pyi | Added type annotations for share_name, file_name, file_path, directory_path, allow_trailing_dot, allow_source_trailing_dot, and file_request_intent |
| sdk/storage/azure-storage-file-share/azure/storage/fileshare/aio/_directory_client_async.pyi | Added type annotations for share_name, directory_path, allow_trailing_dot, allow_source_trailing_dot, and file_request_intent |
| sdk/storage/azure-storage-file-share/samples/file_samples_share.py | Added property accesses to validate ShareClient attributes |
| sdk/storage/azure-storage-file-share/samples/file_samples_share_async.py | Added property accesses to validate async ShareClient attributes |
| sdk/storage/azure-storage-file-share/samples/file_samples_hello_world.py | Added property accesses to validate ShareFileClient attributes |
| sdk/storage/azure-storage-file-share/samples/file_samples_hello_world_async.py | Added property accesses to validate async ShareFileClient attributes |
| sdk/storage/azure-storage-file-share/samples/file_samples_directory.py | Added property accesses to validate ShareDirectoryClient attributes |
| sdk/storage/azure-storage-file-share/samples/file_samples_directory_async.py | Added property accesses to validate async ShareDirectoryClient attributes |
| sdk/storage/azure-storage-blob/azure/storage/blob/_blob_client.pyi | Added type annotations for container_name, blob_name, snapshot, and version_id |
| sdk/storage/azure-storage-blob/azure/storage/blob/aio/_blob_client_async.pyi | Added type annotations for container_name, blob_name, snapshot, and version_id |
| sdk/storage/azure-storage-blob/samples/blob_samples_hello_world.py | Added property accesses to validate BlobClient and ContainerClient attributes |
| sdk/storage/azure-storage-blob/samples/blob_samples_hello_world_async.py | Added property accesses to validate async BlobClient and ContainerClient attributes |
API Change CheckAPIView identified API level changes in this PR and created the following API reviews |
Solves #43601