From 152f8a8bebb604196ec567a40f208896ffce8082 Mon Sep 17 00:00:00 2001 From: iscai-msft Date: Fri, 29 May 2020 18:59:16 -0400 Subject: [PATCH 1/2] fix typing and docs for initial_response parameter of LROPoller --- sdk/core/azure-core/azure/core/polling/_async_poller.py | 5 ++--- sdk/core/azure-core/azure/core/polling/_poller.py | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/sdk/core/azure-core/azure/core/polling/_async_poller.py b/sdk/core/azure-core/azure/core/polling/_async_poller.py index 3a792a280a14..3050d1267dc9 100644 --- a/sdk/core/azure-core/azure/core/polling/_async_poller.py +++ b/sdk/core/azure-core/azure/core/polling/_async_poller.py @@ -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 @@ -101,8 +101,7 @@ class AsyncLROPoller(Awaitable, 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 diff --git a/sdk/core/azure-core/azure/core/polling/_poller.py b/sdk/core/azure-core/azure/core/polling/_poller.py index 4dff2ab220f6..e91e1d89e2dd 100644 --- a/sdk/core/azure-core/azure/core/polling/_poller.py +++ b/sdk/core/azure-core/azure/core/polling/_poller.py @@ -140,8 +140,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 @@ -150,7 +149,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 From 5e5d4a0bf1cb8cfc00d203d7ac9ebb953c87a3b9 Mon Sep 17 00:00:00 2001 From: iscai-msft Date: Mon, 1 Jun 2020 10:46:47 -0400 Subject: [PATCH 2/2] removed unnecessary import --- sdk/core/azure-core/azure/core/polling/_poller.py | 1 - 1 file changed, 1 deletion(-) diff --git a/sdk/core/azure-core/azure/core/polling/_poller.py b/sdk/core/azure-core/azure/core/polling/_poller.py index e91e1d89e2dd..a9f670504859 100644 --- a/sdk/core/azure-core/azure/core/polling/_poller.py +++ b/sdk/core/azure-core/azure/core/polling/_poller.py @@ -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