Skip to content

Commit 52ad05e

Browse files
Fixed Typing Updates for Pyright Version 1.1.389 (Azure#39218)
* Fixed Typing Updates for Pyright Version 1.1.389 * remove unused _format_url_section --------- Co-authored-by: Krista Pratico <[email protected]>
1 parent 44f5257 commit 52ad05e

File tree

18 files changed

+1258
-1552
lines changed

18 files changed

+1258
-1552
lines changed

sdk/purview/azure-purview-workflow/azure/purview/workflow/__init__.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,28 @@
55
# Code generated by Microsoft (R) AutoRest Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
8+
# pylint: disable=wrong-import-position
89

9-
from ._client import PurviewWorkflowClient
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._client import PurviewWorkflowClient # type: ignore
1016
from ._version import VERSION
1117

1218
__version__ = VERSION
1319

1420
try:
1521
from ._patch import __all__ as _patch_all
16-
from ._patch import * # pylint: disable=unused-wildcard-import
22+
from ._patch import *
1723
except ImportError:
1824
_patch_all = []
1925
from ._patch import patch_sdk as _patch_sdk
2026

2127
__all__ = [
2228
"PurviewWorkflowClient",
2329
]
24-
__all__.extend([p for p in _patch_all if p not in __all__])
30+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
2531

2632
_patch_sdk()

sdk/purview/azure-purview-workflow/azure/purview/workflow/_client.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
from copy import deepcopy
1010
from typing import Any, TYPE_CHECKING
11+
from typing_extensions import Self
1112

1213
from azure.core import PipelineClient
1314
from azure.core.pipeline import policies
@@ -28,11 +29,10 @@
2829
)
2930

3031
if TYPE_CHECKING:
31-
# pylint: disable=unused-import,ungrouped-imports
3232
from azure.core.credentials import TokenCredential
3333

3434

35-
class PurviewWorkflowClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
35+
class PurviewWorkflowClient: # pylint: disable=too-many-instance-attributes
3636
"""Workflows are automated, repeatable business processes which allow organizations to track
3737
changes, enforce policy compliance, and ensure quality data across their data
3838
landscape.Workflow service is a micro service within Microsoft Purview to validate and
@@ -102,7 +102,7 @@ def __init__(self, endpoint: str, credential: "TokenCredential", **kwargs: Any)
102102
self.approval = ApprovalOperations(self._client, self._config, self._serialize, self._deserialize)
103103
self.task_status = TaskStatusOperations(self._client, self._config, self._serialize, self._deserialize)
104104

105-
def send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
105+
def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
106106
"""Runs the network request through the client's chained policies.
107107
108108
>>> from azure.core.rest import HttpRequest
@@ -126,12 +126,12 @@ def send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
126126
}
127127

128128
request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
129-
return self._client.send_request(request_copy, **kwargs)
129+
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
130130

131131
def close(self) -> None:
132132
self._client.close()
133133

134-
def __enter__(self) -> "PurviewWorkflowClient":
134+
def __enter__(self) -> Self:
135135
self._client.__enter__()
136136
return self
137137

sdk/purview/azure-purview-workflow/azure/purview/workflow/_configuration.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@
1313
from ._version import VERSION
1414

1515
if TYPE_CHECKING:
16-
# pylint: disable=unused-import,ungrouped-imports
1716
from azure.core.credentials import TokenCredential
1817

1918

20-
class PurviewWorkflowClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
19+
class PurviewWorkflowClientConfiguration: # pylint: disable=too-many-instance-attributes
2120
"""Configuration for PurviewWorkflowClient.
2221
2322
Note that all parameters used to create this instance are saved as instance
@@ -55,9 +54,9 @@ def _configure(self, **kwargs: Any) -> None:
5554
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
5655
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
5756
self.http_logging_policy = kwargs.get("http_logging_policy") or policies.HttpLoggingPolicy(**kwargs)
58-
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
5957
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
6058
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
59+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
6160
self.authentication_policy = kwargs.get("authentication_policy")
6261
if self.credential and not self.authentication_policy:
6362
self.authentication_policy = policies.BearerTokenCredentialPolicy(

sdk/purview/azure-purview-workflow/azure/purview/workflow/_patch.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Copyright (c) Microsoft Corporation.
33
# Licensed under the MIT License.
44
# ------------------------------------
5+
56
"""Customize generated code here.
67
78
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize

0 commit comments

Comments
 (0)