Skip to content

Commit

Permalink
[Storage] [STG 94] Merge STG 94 into main branch (#35888)
Browse files Browse the repository at this point in the history
  • Loading branch information
weirongw23-msft authored Jun 6, 2024
1 parent bf4ee7f commit 215bb40
Show file tree
Hide file tree
Showing 115 changed files with 1,561 additions and 581 deletions.
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_c4f327d388"
"Tag": "python/storage/azure-storage-blob_275000b78a"
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class AzureBlobStorage: # pylint: disable=client-accepts-api-version-keyword
:param base_url: Service URL. Required. Default value is "".
:type base_url: str
:keyword version: Specifies the version of the operation to use for this request. Default value
is "2021-12-02". Note that overriding this default value may result in unsupported behavior.
is "2024-08-04". Note that overriding this default value may result in unsupported behavior.
:paramtype version: str
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ class AzureBlobStorageConfiguration: # pylint: disable=too-many-instance-attrib
desired operation. Required.
:type url: str
:keyword version: Specifies the version of the operation to use for this request. Default value
is "2021-12-02". Note that overriding this default value may result in unsupported behavior.
is "2024-08-04". Note that overriding this default value may result in unsupported behavior.
:paramtype version: str
"""

def __init__(self, url: str, **kwargs: Any) -> None:
version: Literal["2021-12-02"] = kwargs.pop("version", "2021-12-02")
version: Literal["2024-08-04"] = kwargs.pop("version", "2024-08-04")

if url is None:
raise ValueError("Parameter 'url' must not be None.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,7 @@

# This file is used for handwritten extensions to the generated code. Example:
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md


def patch_sdk():
pass
Original file line number Diff line number Diff line change
Expand Up @@ -1441,7 +1441,7 @@ def _deserialize(self, target_obj, data):
elif isinstance(response, type) and issubclass(response, Enum):
return self.deserialize_enum(data, response)

if data is None:
if data is None or data is CoreNull:
return data
try:
attributes = response._attribute_map # type: ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class AzureBlobStorage: # pylint: disable=client-accepts-api-version-keyword
:param base_url: Service URL. Required. Default value is "".
:type base_url: str
:keyword version: Specifies the version of the operation to use for this request. Default value
is "2021-12-02". Note that overriding this default value may result in unsupported behavior.
is "2024-08-04". Note that overriding this default value may result in unsupported behavior.
:paramtype version: str
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ class AzureBlobStorageConfiguration: # pylint: disable=too-many-instance-attrib
desired operation. Required.
:type url: str
:keyword version: Specifies the version of the operation to use for this request. Default value
is "2021-12-02". Note that overriding this default value may result in unsupported behavior.
is "2024-08-04". Note that overriding this default value may result in unsupported behavior.
:paramtype version: str
"""

def __init__(self, url: str, **kwargs: Any) -> None:
version: Literal["2021-12-02"] = kwargs.pop("version", "2021-12-02")
version: Literal["2024-08-04"] = kwargs.pop("version", "2024-08-04")

if url is None:
raise ValueError("Parameter 'url' must not be None.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,7 @@

# This file is used for handwritten extensions to the generated code. Example:
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md


def patch_sdk():
pass
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import datetime
from typing import Any, Callable, Dict, IO, Literal, Optional, TypeVar, Union
import sys
from typing import Any, Callable, Dict, IO, Literal, Optional, Type, TypeVar, Union

from azure.core.exceptions import (
ClientAuthenticationError,
Expand All @@ -32,6 +33,10 @@
build_seal_request,
)

if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]

Expand Down Expand Up @@ -119,7 +124,7 @@ async def create( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down Expand Up @@ -295,7 +300,7 @@ async def append_block( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down Expand Up @@ -484,7 +489,7 @@ async def append_block_from_url( # pylint: disable=inconsistent-return-statemen
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down Expand Up @@ -646,7 +651,7 @@ async def seal( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down
Loading

0 comments on commit 215bb40

Please sign in to comment.