Skip to content

Commit

Permalink
fix mypy for release/v3 branch (#12514)
Browse files Browse the repository at this point in the history
  • Loading branch information
kristapratico authored Jul 13, 2020
1 parent cb050d5 commit ed4c2a6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import json
from typing import (
Any,
Iterable,
Dict,
Union,
TYPE_CHECKING,
Expand Down Expand Up @@ -39,6 +38,7 @@
from azure.core.credentials import AzureKeyCredential, TokenCredential
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpResponse
from azure.core.paging import ItemPaged
PipelineResponseType = HttpResponse


Expand Down Expand Up @@ -182,7 +182,7 @@ def delete_model(self, model_id, **kwargs):

@distributed_trace
def list_custom_models(self, **kwargs):
# type: (Any) -> Iterable[CustomFormModelInfo]
# type: (Any) -> ItemPaged[CustomFormModelInfo]
"""List information for each model, including model id,
model status, and when it was created and last modified.
Expand All @@ -199,7 +199,7 @@ def list_custom_models(self, **kwargs):
:dedent: 8
:caption: List model information for each model on the account.
"""
return self._client.list_custom_models(
return self._client.list_custom_models( # type: ignore
cls=kwargs.pop("cls", lambda objs: [CustomFormModelInfo._from_generated(x) for x in objs]),
error_map=error_map,
**kwargs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import json
from typing import (
Any,
AsyncIterable,
Dict,
Union,
TYPE_CHECKING,
Expand All @@ -18,6 +17,7 @@
from azure.core.polling.async_base_polling import AsyncLROBasePolling
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.async_paging import AsyncItemPaged
from ._form_recognizer_client_async import FormRecognizerClient
from .._generated.aio._form_recognizer_client_async import FormRecognizerClient as FormRecognizer
from .._generated.models import (
Expand Down Expand Up @@ -188,7 +188,7 @@ async def delete_model(self, model_id: str, **kwargs: Any) -> None:
)

@distributed_trace
def list_custom_models(self, **kwargs: Any) -> AsyncIterable[CustomFormModelInfo]:
def list_custom_models(self, **kwargs: Any) -> AsyncItemPaged[CustomFormModelInfo]:
"""List information for each model, including model id,
model status, and when it was created and last modified.
Expand All @@ -205,7 +205,7 @@ def list_custom_models(self, **kwargs: Any) -> AsyncIterable[CustomFormModelInfo
:dedent: 12
:caption: List model information for each model on the account.
"""
return self._client.list_custom_models(
return self._client.list_custom_models( # type: ignore
cls=kwargs.pop("cls", lambda objs: [CustomFormModelInfo._from_generated(x) for x in objs]),
error_map=error_map,
**kwargs
Expand Down

0 comments on commit ed4c2a6

Please sign in to comment.