Skip to content

Commit

Permalink
[Storage] HttpResponse changes (new generated code) (#36546)
Browse files Browse the repository at this point in the history
  • Loading branch information
vincenttran-msft authored Aug 22, 2024
1 parent 21774d5 commit ca110c9
Show file tree
Hide file tree
Showing 65 changed files with 544 additions and 999 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_adfb24f3d6"
"Tag": "python/storage/azure-storage-blob_fad0e99de3"
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from copy import deepcopy
from typing import Any
from typing_extensions import Self

from azure.core import PipelineClient
from azure.core.pipeline import policies
Expand Down Expand Up @@ -110,7 +111,7 @@ def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
def close(self) -> None:
self._client.close()

def __enter__(self) -> "AzureBlobStorage":
def __enter__(self) -> Self:
self._client.__enter__()
return self

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ def _json_attemp(data):
# context otherwise.
_LOGGER.critical("Wasn't XML not JSON, failing")
raise DeserializationError("XML is invalid") from err
elif content_type.startswith("text/"):
return data_as_str
raise DeserializationError("Cannot deserialize content-type: {}".format(content_type))

@classmethod
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from copy import deepcopy
from typing import Any, Awaitable
from typing_extensions import Self

from azure.core import AsyncPipelineClient
from azure.core.pipeline import policies
Expand Down Expand Up @@ -112,7 +113,7 @@ def _send_request(
async def close(self) -> None:
await self._client.close()

async def __aenter__(self) -> "AzureBlobStorage":
async def __aenter__(self) -> Self:
await self._client.__aenter__()
return self

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import AsyncHttpResponse
from azure.core.rest import HttpRequest
from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict

from ... import models as _models
from ..._vendor import _convert_request
from ...operations._append_blob_operations import (
build_append_block_from_url_request,
build_append_block_request,
Expand Down Expand Up @@ -207,7 +205,6 @@ async def create( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)

_stream = False
Expand Down Expand Up @@ -372,7 +369,6 @@ async def append_block( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)

_stream = False
Expand Down Expand Up @@ -574,7 +570,6 @@ async def append_block_from_url( # pylint: disable=inconsistent-return-statemen
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)

_stream = False
Expand Down Expand Up @@ -696,7 +691,6 @@ async def seal( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)

_stream = False
Expand Down
Loading

0 comments on commit ca110c9

Please sign in to comment.