Skip to content
Merged
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
7 changes: 7 additions & 0 deletions .chronus/changes/multiapi_mypy-2025-0-6-15-4-4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
changeKind: fix
packages:
- "@autorest/python"
---

Improve mypy typing for pipeline clients in deprecated multiapi package
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ def __init__(
**kwargs: Any
){{" -> None" if async_mode else "" }}:{% endmacro %}
{# actual template starts here #}
{% set pipeline_client = "ARMPipelineClient" if azure_arm else "PipelineClient" %}
{% set relative_path = ".." if async_mode else "." %}
{% set def = "async def" if async_mode else "def" %}
{% set async_prefix = "Async" if async_mode else "" %}
Expand Down Expand Up @@ -97,7 +96,7 @@ class {{ code_model.client.name }}({% if code_model.operation_mixin_group.mixin_
{{ p }},
{% endfor %}
]
self._client = {{ async_prefix }}{{ code_model.client.pipeline_client }}(base_url={{ code_model.host_variable_name }}, policies=_policies, **kwargs)
self._client: {{ async_prefix }}{{ code_model.client.pipeline_client }} = {{ async_prefix }}{{ code_model.client.pipeline_client }}(base_url={{ code_model.host_variable_name }}, policies=_policies, **kwargs)
super({{ code_model.client.name }}, self).__init__(
api_version=api_version,
profile=profile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def __init__(
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
self._config.http_logging_policy,
]
self._client = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
super(MultiapiServiceClient, self).__init__(api_version=api_version, profile=profile)

@classmethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def __init__(
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
self._config.http_logging_policy,
]
self._client = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
super(MultiapiServiceClient, self).__init__(api_version=api_version, profile=profile)

@classmethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def __init__(
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
self._config.http_logging_policy,
]
self._client = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
super(MultiapiServiceClient, self).__init__(
api_version=api_version,
profile=profile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def __init__(
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
self._config.http_logging_policy,
]
self._client = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
super(MultiapiServiceClient, self).__init__(
api_version=api_version,
profile=profile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def __init__(
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
self._config.http_logging_policy,
]
self._client = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
super(MultiapiServiceClient, self).__init__(
api_version=api_version,
profile=profile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def __init__(
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
self._config.http_logging_policy,
]
self._client = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
super(MultiapiServiceClient, self).__init__(
api_version=api_version,
profile=profile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def __init__(
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
self._config.http_logging_policy,
]
self._client = PipelineClient(base_url=base_url, policies=_policies, **kwargs)
self._client: PipelineClient = PipelineClient(base_url=base_url, policies=_policies, **kwargs)
super(MultiapiCustomBaseUrlServiceClient, self).__init__(
api_version=api_version,
profile=profile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def __init__(
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
self._config.http_logging_policy,
]
self._client = AsyncPipelineClient(base_url=base_url, policies=_policies, **kwargs)
self._client: AsyncPipelineClient = AsyncPipelineClient(base_url=base_url, policies=_policies, **kwargs)
super(MultiapiCustomBaseUrlServiceClient, self).__init__(
api_version=api_version,
profile=profile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def __init__(
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
self._config.http_logging_policy,
]
self._client = PipelineClient(base_url=base_url, policies=_policies, **kwargs)
self._client: PipelineClient = PipelineClient(base_url=base_url, policies=_policies, **kwargs)
super(MultiapiServiceClient, self).__init__(
api_version=api_version,
profile=profile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def __init__(
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
self._config.http_logging_policy,
]
self._client = AsyncPipelineClient(base_url=base_url, policies=_policies, **kwargs)
self._client: AsyncPipelineClient = AsyncPipelineClient(base_url=base_url, policies=_policies, **kwargs)
super(MultiapiServiceClient, self).__init__(
api_version=api_version,
profile=profile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def __init__(
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
self._config.http_logging_policy,
]
self._client = PipelineClient(base_url=base_url, policies=_policies, **kwargs)
self._client: PipelineClient = PipelineClient(base_url=base_url, policies=_policies, **kwargs)
super(MultiapiServiceClient, self).__init__(
api_version=api_version,
profile=profile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def __init__(
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
self._config.http_logging_policy,
]
self._client = AsyncPipelineClient(base_url=base_url, policies=_policies, **kwargs)
self._client: AsyncPipelineClient = AsyncPipelineClient(base_url=base_url, policies=_policies, **kwargs)
super(MultiapiServiceClient, self).__init__(
api_version=api_version,
profile=profile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def __init__(
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
self._config.http_logging_policy,
]
self._client = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
super(MultiapiServiceClient, self).__init__(
api_version=api_version,
profile=profile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def __init__(
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
self._config.http_logging_policy,
]
self._client = PipelineClient(base_url=base_url, policies=_policies, **kwargs)
self._client: PipelineClient = PipelineClient(base_url=base_url, policies=_policies, **kwargs)
super(MultiapiServiceClient, self).__init__(
api_version=api_version,
profile=profile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def __init__(
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
self._config.http_logging_policy,
]
self._client = AsyncPipelineClient(base_url=base_url, policies=_policies, **kwargs)
self._client: AsyncPipelineClient = AsyncPipelineClient(base_url=base_url, policies=_policies, **kwargs)
super(MultiapiServiceClient, self).__init__(
api_version=api_version,
profile=profile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def __init__(
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
self._config.http_logging_policy,
]
self._client = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
super(MultiapiServiceClient, self).__init__(
api_version=api_version,
profile=profile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def __init__(
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
self._config.http_logging_policy,
]
self._client = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
super(MultiapiServiceClient, self).__init__(
api_version=api_version,
profile=profile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def __init__(
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
self._config.http_logging_policy,
]
self._client = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
super(MultiapiServiceClient, self).__init__(
api_version=api_version,
profile=profile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def __init__(
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
self._config.http_logging_policy,
]
self._client = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
super(MultiapiServiceClient, self).__init__(
api_version=api_version,
profile=profile
Expand Down
Loading