Skip to content

[AutoPR azure-ai-vision-face] fix spread for face #7561

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

Closed
wants to merge 1 commit into from
Closed
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
5 changes: 2 additions & 3 deletions sdk/face/azure-ai-vision-face/_meta.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"commit": "37acfe2967e5e1be1169146ac461eb1875c9476e",
"commit": "2aeb94aa1de1dc3cd9ffb8e41200948b1891811f",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"typespec_src": "specification/ai/Face",
"@azure-tools/typespec-python": "0.23.8",
"@autorest/python": "6.13.15"
"@azure-tools/typespec-python": "0.25.0"
}
12 changes: 8 additions & 4 deletions sdk/face/azure-ai-vision-face/azure/ai/vision/face/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,23 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from ._patch import FaceClient
from ._patch import FaceSessionClient
from ._client import FaceClient
from ._client import FaceSessionClient
from ._version import VERSION

__version__ = VERSION


try:
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk

__all__ = [
"FaceClient",
"FaceSessionClient",
]

__all__.extend([p for p in _patch_all if p not in __all__])

_patch_sdk()
5 changes: 3 additions & 2 deletions sdk/face/azure-ai-vision-face/azure/ai/vision/face/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from copy import deepcopy
from typing import Any, TYPE_CHECKING, Union
from typing_extensions import Self

from azure.core import PipelineClient
from azure.core.credentials import AzureKeyCredential
Expand Down Expand Up @@ -94,7 +95,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
def close(self) -> None:
self._client.close()

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

Expand Down Expand Up @@ -173,7 +174,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
def close(self) -> None:
self._client.close()

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -883,5 +883,6 @@ def rest_discriminator(
*,
name: typing.Optional[str] = None,
type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin
visibility: typing.Optional[typing.List[str]] = None,
) -> typing.Any:
return _RestField(name=name, type=type, is_discriminator=True)
return _RestField(name=name, type=type, is_discriminator=True, visibility=visibility)
1,452 changes: 431 additions & 1,021 deletions sdk/face/azure-ai-vision-face/azure/ai/vision/face/_operations/_operations.py

Large diffs are not rendered by default.

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 Expand Up @@ -1441,7 +1443,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 @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "1.0.0b2"
VERSION = "1.0.0b1"
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,20 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from ._patch import FaceClient
from ._patch import FaceSessionClient

from ._client import FaceClient
from ._client import FaceSessionClient

try:
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk

__all__ = [
"FaceClient",
"FaceSessionClient",
]

__all__.extend([p for p in _patch_all if p not in __all__])

_patch_sdk()
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, TYPE_CHECKING, Union
from typing_extensions import Self

from azure.core import AsyncPipelineClient
from azure.core.credentials import AzureKeyCredential
Expand Down Expand Up @@ -98,7 +99,7 @@ def send_request(
async def close(self) -> None:
await self._client.close()

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

Expand Down Expand Up @@ -181,7 +182,7 @@ def send_request(
async def close(self) -> None:
await self._client.close()

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

Expand Down
Loading