Skip to content

[communication] type signature for shared CommunicationTokenRefreshOptions prevents mypy from checking #23265

@kristapratico

Description

@kristapratico

All of the packages under sdk/communication which contain the _shared directory are prevented from running mypy due to the typing in the init of CommunicationTokenRefreshOptions:

class CommunicationTokenRefreshOptions(object):
"""Options for refreshing CommunicationTokenCredential.
:param str token: The token used to authenticate to an Azure Communication service
:param token_refresher: The token refresher to provide capacity to fetch fresh token
:raises: TypeError
"""
def __init__(self,
token, # type: str
token_refresher=None
):
# type: (str) -> None

This is reproducible by running mypy==0.931 at the package level directory:

azure-sdk-for-python\sdk\communication\azure-communication-chat>python -m mypy ./azure
azure\communication\chat\_shared\user_token_refresh_options.py:20: error: Function has duplicate type signatures
azure\communication\chat\_shared\user_token_refresh_options.py:20: error: Type signature has too few arguments
Found 2 errors in 1 file (errors prevented further checking)

Metadata

Metadata

Assignees

No one assigned

    Labels

    ClientThis issue points to a problem in the data-plane of the library.CommunicationService AttentionWorkflow: This issue is responsible by Azure service team.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions