Azure / Azure/azure-sdk-for-python

Type Check failing after azure-mgmt-resourcegraph update

Open
#44,158 4 comments 0 reactions 1 assignee Claimed by @msyyc View on GitHub
CodeGen customer-reported Mgmt needs-team-attention question
Dominant language
Python
Stars
5.6k
Forks
3.4k
Avg merge
1d 21h
Merged PRs (30d)
193

Description

- **Package Name**: azure-mgmt-resourcegraph
- **Package Version**: 8.0.1
- **Operating System**: ubuntu (latest)
- **Python Version**: 3.11.14

**Describe the bug**
As part of our build pipeline stage we run a "Run type checks" step using: pyright .\src\.

Since this morning this check fails our ResourceGraphHelper Python Function which uses:
"from azure.mgmt.resourcegraph import ResourceGraphClient"

We have not made any change to this function and the build run successfully since this morning.

The error we are getting is:
Argument of type "Literal[0]" cannot be assigned to parameter "key" of type "str" in function "__getitem__"
"Literal[0]" is not assignable to "str" (reportArgumentType)

This is part of the code:
```python
f not isinstance(response.data, list) or not isinstance(response.data[0], dict) or mgmt_group_id_key not in response.data[0]:
```
We compared which libraries were downloaded on the pipeline host and the only difference between a working Type check and a failing type check is that the version of the azure-mgmt-resourcegraph changed from v8.0.0 to v8.0.1.

Image

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.