Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mypy error | TypedDict incompatible with a Mapping #31098

Open
mjafferi-msft opened this issue Jul 12, 2023 · 0 comments
Open

Mypy error | TypedDict incompatible with a Mapping #31098

mjafferi-msft opened this issue Jul 12, 2023 · 0 comments
Labels
Client This issue points to a problem in the data-plane of the library. Communication - Identity Service Attention Workflow: This issue is responsible by Azure service team.

Comments

@mjafferi-msft
Copy link
Member

  • Package Name: azure-communication-identity (_shared folder)
  • Python Version: 3.7

Describe the bug

On the basis of raw_id, different Communication Identifiers are created and returned such as PhoneNumberIdentifier, MicrosoftTeamsUserIdentifier, MicrosoftBotIdentifier and so on.
Running mypy command, gives below error :

azure\communication\identity\_shared\models.py:320: error: Incompatible return value type (got "PhoneNumberIdentifier", expected "CommunicationIdentifier")  [return-value]
azure\communication\identity\_shared\models.py:320: note: Following member(s) of "PhoneNumberIdentifier" have conflicts:
azure\communication\identity\_shared\models.py:320: note:     kind: expected "Union[CommunicationIdentifierKind, str, None]", got "CommunicationIdentifierKind"
azure\communication\identity\_shared\models.py:320: note:     properties: expected "Mapping[str, Any]", got "PhoneNumberProperties"

The protocol defined doesn't works for these types. Each identifier has a unique TypedDict which is incompatible with a Mapping (as described here : python/mypy#4976).

Creating this issue to look at the protocol and figure out the solution for this.

@github-actions github-actions bot added the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Jul 12, 2023
@xiangyan99 xiangyan99 added Communication - Identity Service Attention Workflow: This issue is responsible by Azure service team. Client This issue points to a problem in the data-plane of the library. CXP Attention and removed needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. labels Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. Communication - Identity Service Attention Workflow: This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

3 participants