Skip to content

Fix typing contract for max_concurrency in File Share client#45637

Merged
nateprewitt merged 2 commits intoAzure:mainfrom
nateprewitt:max_concurrency_fileshare
Mar 11, 2026
Merged

Fix typing contract for max_concurrency in File Share client#45637
nateprewitt merged 2 commits intoAzure:mainfrom
nateprewitt:max_concurrency_fileshare

Conversation

@nateprewitt
Copy link
Member

Description

PR 3/3 for typing changes started in #45598. This will fix the remaining pieces from the File Share client.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

Copilot AI review requested due to automatic review settings March 11, 2026 00:08
@github-actions github-actions bot added the Storage Storage Service (Queues, Blobs, Files) label Mar 11, 2026
Copy link
Contributor

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 PR aligns the File Share client typing contract and runtime behavior so max_concurrency can be passed as None (meaning “use the SDK default”), matching the pattern established in related storage SDK typing work.

Changes:

  • Update sync/async ShareFileClient stubs to type max_concurrency as Optional[int] = None for upload and download APIs.
  • Add DEFAULT_MAX_CONCURRENCY and use it when callers pass max_concurrency=None (including deprecated download helpers).
  • Add sync/async tests validating that max_concurrency=None does not raise and operations succeed.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
sdk/storage/azure-storage-file-share/tests/test_file.py Adds coverage for max_concurrency=None on sync upload/download.
sdk/storage/azure-storage-file-share/tests/test_file_async.py Adds coverage for max_concurrency=None on async upload/download.
sdk/storage/azure-storage-file-share/azure/storage/fileshare/_file_client.pyi Updates typing contract for max_concurrency to Optional[int] = None.
sdk/storage/azure-storage-file-share/azure/storage/fileshare/aio/_file_client_async.pyi Updates typing contract for max_concurrency to Optional[int] = None.
sdk/storage/azure-storage-file-share/azure/storage/fileshare/_file_client.py Treats max_concurrency=None as “use default” via DEFAULT_MAX_CONCURRENCY.
sdk/storage/azure-storage-file-share/azure/storage/fileshare/aio/_file_client_async.py Async equivalent handling for max_concurrency=None.
sdk/storage/azure-storage-file-share/azure/storage/fileshare/_download.py Downloader paths accept None and substitute the default.
sdk/storage/azure-storage-file-share/azure/storage/fileshare/aio/_download_async.py Async downloader paths accept None and substitute the default.
sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/constants.py Introduces DEFAULT_MAX_CONCURRENCY = 1.
sdk/storage/azure-storage-file-share/assets.json Updates the assets tag pointer.
Comments suppressed due to low confidence (2)

sdk/storage/azure-storage-file-share/azure/storage/fileshare/_download.py:406

  • max_concurrency now supports None (fallback to DEFAULT_MAX_CONCURRENCY), but the docstrings below still declare :param int max_concurrency:. Please update the docstring to indicate Optional[int] and explain the None behavior.
    def content_as_bytes(self, max_concurrency=None):
        """DEPRECATED: Download the contents of this file.

        This operation is blocking until all data is downloaded.

sdk/storage/azure-storage-file-share/azure/storage/fileshare/aio/_download_async.py:366

  • These deprecated helpers now accept max_concurrency=None (fallback to DEFAULT_MAX_CONCURRENCY), but the docstrings still specify :param int max_concurrency:. Please update the parameter docs to reflect Optional[int] and the None behavior.
    async def content_as_bytes(self, max_concurrency=None):
        """DEPRECATED: Download the contents of this file.

        This operation is blocking until all data is downloaded.

@nateprewitt nateprewitt merged commit 1e540de into Azure:main Mar 11, 2026
20 checks passed
@nateprewitt nateprewitt deleted the max_concurrency_fileshare branch March 11, 2026 18:03
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.

4 participants