Skip to content

[Storage] Decoupled Client Context Manager Methods from Base Client #41442

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

Merged

Conversation

weirongw23-msft
Copy link
Member

No description provided.

@github-actions github-actions bot added the Storage Storage Service (Queues, Blobs, Files) label Jun 5, 2025
@weirongw23-msft
Copy link
Member Author

/azp run python - pullrequest

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@weirongw23-msft
Copy link
Member Author

Placed context managers directly after constructors, removed those implementations from base client (sync / async)

Copy link

github-actions bot commented Jun 6, 2025

API Change Check

APIView identified API level changes in this PR and created the following API reviews

azure-storage-blob
azure-storage-file-datalake
azure-storage-queue
azure-storage-file-share

@weirongw23-msft weirongw23-msft marked this pull request as ready for review June 6, 2025 19:58
@Copilot Copilot AI review requested due to automatic review settings June 6, 2025 19:58
Copy link
Contributor

@Copilot Copilot AI left a 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 pull request decouples context manager methods from the base client into individual client implementations. The key changes include adding enter, exit, and close methods to various synchronous and asynchronous client classes, and removing these context manager methods from shared base classes.

Reviewed Changes

Copilot reviewed 32 out of 32 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
sdk/storage/azure-storage-file-share/azure/storage/fileshare/_share_service_client.py Added sync context manager methods (enter, exit, close)
sdk/storage/azure-storage-file-share/azure/storage/fileshare/_share_client.py Added sync context manager methods with pylint disable comment for too-many-public-methods
sdk/storage/azure-storage-file-share/azure/storage/fileshare/_file_client.py Added sync context manager methods
sdk/storage/azure-storage-file-share/azure/storage/fileshare/_directory_client.py Added sync context manager methods
sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/* Added async context manager methods and adjusted generated client building
sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/* Removed context manager methods from shared base classes
sdk/storage/azure-storage-blob/azure/storage/blob/aio/* Added async context manager methods
sdk/storage/azure-storage-blob/azure/storage/blob/* Added sync context manager methods

@weirongw23-msft weirongw23-msft enabled auto-merge (squash) June 17, 2025 17:31
@weirongw23-msft weirongw23-msft merged commit 51b4670 into Azure:main Jun 17, 2025
20 checks passed
@weirongw23-msft weirongw23-msft deleted the weirongw23/client-context-managers branch June 17, 2025 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants