Skip to content

Commit

Permalink
fix typing and docs for initial_response parameter of LROPoller (#11717)
Browse files Browse the repository at this point in the history
* fix typing and docs for initial_response parameter of LROPoller

* removed unnecessary import
  • Loading branch information
iscai-msft authored Jun 4, 2020
1 parent da470e0 commit bce84db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
5 changes: 2 additions & 3 deletions sdk/core/azure-core/azure/core/polling/_async_poller.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ async def async_poller(client, initial_response, deserialization_callback, polli
:param client: A pipeline service client.
:type client: ~azure.core.PipelineClient
:param initial_response: The initial call response
:type initial_response: ~azure.core.pipeline.transport.AsyncHttpResponse
:type initial_response: ~azure.core.pipeline.PipelineResponse
:param deserialization_callback: A callback that takes a Response and return a deserialized object.
If a subclass of Model is given, this passes "deserialize" as callback.
:type deserialization_callback: callable or msrest.serialization.Model
Expand All @@ -101,8 +101,7 @@ class AsyncLROPoller(Generic[PollingReturnType], Awaitable):
:param client: A pipeline service client
:type client: ~azure.core.PipelineClient
:param initial_response: The initial call response
:type initial_response:
~azure.core.pipeline.transport.HttpResponse or ~azure.core.pipeline.transport.AsyncHttpResponse
:type initial_response: ~azure.core.pipeline.PipelineResponse
:param deserialization_callback: A callback that takes a Response and return a deserialized object.
If a subclass of Model is given, this passes "deserialize" as callback.
:type deserialization_callback: callable or msrest.serialization.Model
Expand Down
6 changes: 2 additions & 4 deletions sdk/core/azure-core/azure/core/polling/_poller.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
from urllib.parse import urlparse

from typing import Any, Callable, Union, List, Optional, Tuple, TypeVar, Generic
from azure.core.pipeline.transport._base import HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.common import with_current_context

Expand Down Expand Up @@ -140,8 +139,7 @@ class LROPoller(Generic[PollingReturnType]):
:param client: A pipeline service client
:type client: ~azure.core.PipelineClient
:param initial_response: The initial call response
:type initial_response:
~azure.core.pipeline.transport.HttpResponse or ~azure.core.pipeline.transport.AsyncHttpResponse
:type initial_response: ~azure.core.pipeline.PipelineResponse
:param deserialization_callback: A callback that takes a Response and return a deserialized object.
If a subclass of Model is given, this passes "deserialize" as callback.
:type deserialization_callback: callable or msrest.serialization.Model
Expand All @@ -150,7 +148,7 @@ class LROPoller(Generic[PollingReturnType]):
"""

def __init__(self, client, initial_response, deserialization_callback, polling_method):
# type: (Any, HttpResponse, Callable, PollingMethod[PollingReturnType]) -> None
# type: (Any, Any, Callable, PollingMethod[PollingReturnType]) -> None
self._callbacks = [] # type: List[Callable]
self._polling_method = polling_method

Expand Down

0 comments on commit bce84db

Please sign in to comment.