Skip to content

[Storage] STG 98 Soft GA Prep #41872

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

Open
wants to merge 6 commits into
base: release/storage/stg98-ga2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions sdk/storage/azure-storage-blob/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
### Features Added
- Stable release of features from 12.26.0b1

### Bugs Fixed
- Fixed an issue where `BlobClient`'s `start_copy_from_url` with `incremental_copy=True` results in `TypeError`.

## 12.26.0b1 (2025-05-06)

### Features Added
Expand Down
2 changes: 1 addition & 1 deletion sdk/storage/azure-storage-blob/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "python",
"TagPrefix": "python/storage/azure-storage-blob",
"Tag": "python/storage/azure-storage-blob_56ef3e2a11"
"Tag": "python/storage/azure-storage-blob_e7a8cad1a0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def upload_blob_to_url(
entire blocks, and doing so defeats the purpose of the memory-efficient algorithm.
:keyword str encoding:
Encoding to use if text is supplied as input. Defaults to UTF-8.
:returns: Blob-updated property dict (Etag and last modified)
:return: Blob-updated property dict (Etag and last modified)
:rtype: dict(str, Any)
"""
with BlobClient.from_blob_url(blob_url, credential=credential) as client:
Expand Down Expand Up @@ -153,7 +153,7 @@ def download_blob_from_url(
:param output:
Where the data should be downloaded to. This could be either a file path to write to,
or an open IO handle to write to.
:type output: str or writable stream.
:type output: str or IO.
:param credential:
The credentials with which to authenticate. This is optional if the
blob URL already has a SAS token or the blob is public. The value can be a SAS token string,
Expand Down Expand Up @@ -190,6 +190,7 @@ def download_blob_from_url(
blob. Also note that if enabled, the memory-efficient upload algorithm
will not be used, because computing the MD5 hash requires buffering
entire blocks, and doing so defeats the purpose of the memory-efficient algorithm.
:return: None
:rtype: None
"""
overwrite = kwargs.pop('overwrite', False)
Expand Down
81 changes: 43 additions & 38 deletions sdk/storage/azure-storage-blob/azure/storage/blob/_blob_client.py

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def _download_blob_options(
The string representing the SDK package version.
:param AzureBlobStorage client:
The generated Blob Storage client.
:returns: A dictionary containing the download blob options.
:return: A dictionary containing the download blob options.
:rtype: Dict[str, Any]
"""
if length is not None:
Expand Down Expand Up @@ -658,19 +658,20 @@ def _start_copy_from_url_options( # pylint:disable=too-many-statements

options = {
'copy_source': source_url,
'seal_blob': kwargs.pop('seal_destination_blob', None),
'timeout': timeout,
'modified_access_conditions': dest_mod_conditions,
'blob_tags_string': blob_tags_string,
'headers': headers,
'cls': return_response_headers,
}

if not incremental_copy:
source_mod_conditions = get_source_conditions(kwargs)
dest_access_conditions = get_access_conditions(kwargs.pop('destination_lease', None))
options['source_modified_access_conditions'] = source_mod_conditions
options['lease_access_conditions'] = dest_access_conditions
options['tier'] = tier.value if tier else None
options['seal_blob'] = kwargs.pop('seal_destination_blob', None)
options['blob_tags_string'] = blob_tags_string
options.update(kwargs)
return options

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def _format_url(self, hostname):

:param str hostname:
The hostname of the current location mode.
:returns: A formatted endpoint URL including current location mode hostname.
:return: A formatted endpoint URL including current location mode hostname.
:rtype: str
"""
return f"{self.scheme}://{hostname}/{self._query_str}"
Expand Down Expand Up @@ -169,7 +169,7 @@ def from_connection_string(
:keyword str audience: The audience to use when requesting tokens for Azure Active Directory
authentication. Only has an effect when credential is of type TokenCredential. The value could be
https://storage.azure.com/ (default) or https://<account>.blob.core.windows.net.
:returns: A Blob service client.
:return: A Blob service client.
:rtype: ~azure.storage.blob.BlobServiceClient

.. admonition:: Example:
Expand Down Expand Up @@ -206,7 +206,7 @@ def get_user_delegation_key(
This value is not tracked or validated on the client. To configure client-side network timesouts
see `here <https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-blob
#other-client--per-operation-configuration>`__.
:returns: The user delegation key.
:return: The user delegation key.
:rtype: ~azure.storage.blob.UserDelegationKey
"""
key_info = KeyInfo(start=_to_utc_datetime(key_start_time), expiry=_to_utc_datetime(key_expiry_time))
Expand All @@ -227,7 +227,7 @@ def get_account_information(self, **kwargs: Any) -> Dict[str, str]:
The information can also be retrieved if the user has a SAS to a container or blob.
The keys in the returned dictionary include 'sku_name' and 'account_kind'.

:returns: A dict of account information (SKU and account type).
:return: A dict of account information (SKU and account type).
:rtype: dict(str, str)

.. admonition:: Example:
Expand Down Expand Up @@ -270,7 +270,7 @@ def get_service_stats(self, **kwargs: Any) -> Dict[str, Any]:
This value is not tracked or validated on the client. To configure client-side network timesouts
see `here <https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-blob
#other-client--per-operation-configuration>`__.
:returns: The blob service stats.
:return: The blob service stats.
:rtype: Dict[str, Any]

.. admonition:: Example:
Expand Down Expand Up @@ -301,7 +301,7 @@ def get_service_properties(self, **kwargs: Any) -> Dict[str, Any]:
This value is not tracked or validated on the client. To configure client-side network timesouts
see `here <https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-blob
#other-client--per-operation-configuration>`__.
:returns: An object containing blob service properties such as
:return: An object containing blob service properties such as
analytics logging, hour/minute metrics, cors rules, etc.
:rtype: Dict[str, Any]

Expand Down Expand Up @@ -371,6 +371,7 @@ def set_service_properties(
This value is not tracked or validated on the client. To configure client-side network timesouts
see `here <https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-blob
#other-client--per-operation-configuration>`__.
:return: None
:rtype: None

.. admonition:: Example:
Expand Down Expand Up @@ -435,7 +436,7 @@ def list_containers(
This value is not tracked or validated on the client. To configure client-side network timesouts
see `here <https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-blob
#other-client--per-operation-configuration>`__.
:returns: An iterable (auto-paging) of ContainerProperties.
:return: An iterable (auto-paging) of ContainerProperties.
:rtype: ~azure.core.paging.ItemPaged[~azure.storage.blob.ContainerProperties]

.. admonition:: Example:
Expand Down Expand Up @@ -489,7 +490,7 @@ def find_blobs_by_tags(self, filter_expression: str, **kwargs: Any) -> ItemPaged
This value is not tracked or validated on the client. To configure client-side network timesouts
see `here <https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-blob
#other-client--per-operation-configuration>`__.
:returns: An iterable (auto-paging) response of BlobProperties.
:return: An iterable (auto-paging) response of BlobProperties.
:rtype: ~azure.core.paging.ItemPaged[~azure.storage.blob.FilteredBlob]
"""

Expand Down Expand Up @@ -538,7 +539,7 @@ def create_container(
This value is not tracked or validated on the client. To configure client-side network timesouts
see `here <https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-blob
#other-client--per-operation-configuration>`__.
:returns: A container client to interact with the newly created container.
:return: A container client to interact with the newly created container.
:rtype: ~azure.storage.blob.ContainerClient

.. admonition:: Example:
Expand Down Expand Up @@ -600,6 +601,8 @@ def delete_container(
This value is not tracked or validated on the client. To configure client-side network timesouts
see `here <https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-blob
#other-client--per-operation-configuration>`__.
:return: None
:rtype: None

.. admonition:: Example:

Expand Down Expand Up @@ -638,7 +641,7 @@ def _rename_container(self, name: str, new_name: str, **kwargs: Any) -> Containe
This value is not tracked or validated on the client. To configure client-side network timesouts
see `here <https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-blob
#other-client--per-operation-configuration>`__.
:returns: A container client for the renamed container.
:return: A container client for the renamed container.
:rtype: ~azure.storage.blob.ContainerClient
"""
renamed_container = self.get_container_client(new_name)
Expand Down Expand Up @@ -677,7 +680,7 @@ def undelete_container(
This value is not tracked or validated on the client. To configure client-side network timesouts
see `here <https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-blob
#other-client--per-operation-configuration>`__.
:returns: The undeleted ContainerClient.
:return: The undeleted ContainerClient.
:rtype: ~azure.storage.blob.ContainerClient
"""
new_name = kwargs.pop('new_name', None)
Expand All @@ -701,7 +704,7 @@ def get_container_client(self, container: Union[ContainerProperties, str]) -> Co
The container. This can either be the name of the container,
or an instance of ContainerProperties.
:type container: str or ~azure.storage.blob.ContainerProperties
:returns: A ContainerClient.
:return: A ContainerClient.
:rtype: ~azure.storage.blob.ContainerClient

.. admonition:: Example:
Expand Down Expand Up @@ -750,7 +753,7 @@ def get_blob_client(
:type snapshot: str or dict(str, Any)
:keyword str version_id: The version id parameter is an opaque DateTime value that, when present,
specifies the version of the blob to operate on.
:returns: A BlobClient.
:return: A BlobClient.
:rtype: ~azure.storage.blob.BlobClient

.. admonition:: Example:
Expand Down
Loading
Loading