Open azure-sdk opened 10 months ago
This was opened because there are 10 mypy errors in the samples. It would be great to clean these up so both src and samples are mypy compliant.
samples/examples_async.py:76: error: Incompatible types in assignment (expression has type "Dict[str, Any]", variable has type "ContainerProxy") [assignment]
samples/examples_async.py:77: error: Value of type "ContainerProxy" is not indexable [index]
samples/examples.py:69: error: Incompatible types in assignment (expression has type "Dict[str, Any]", variable has type "ContainerProxy") [assignment]
samples/examples.py:70: error: Value of type "ContainerProxy" is not indexable [index]
samples/concurrency_sample.py:102: error: Argument 1 to "create_task" has incompatible type "Awaitable[None]"; expected "Union[Generator[Any, None, <nothing>], Coroutine[Any, Any, <nothing>]]" [arg-type]
samples/access_cosmos_with_resource_token_async.py:181: error: Dict entry 3 has incompatible type "str": "List[str]"; expected "str": "str" [dict-item]
samples/access_cosmos_with_resource_token_async.py:216: error: Dict entry 2 has incompatible type "str": "Optional[Any]"; expected "str": "str" [dict-item]
samples/access_cosmos_with_resource_token.py:184: error: Dict entry 3 has incompatible type "str": "List[str]"; expected "str": "str" [dict-item]
samples/access_cosmos_with_resource_token.py:214: error: Dict entry 2 has incompatible type "str": "Optional[Any]"; expected "str": "str" [dict-item]
samples/access_cosmos_with_aad.py:77: error: Incompatible types in assignment (expression has type "DefaultAzureCredential", variable has type "ClientSecretCredential") [assignment]
Found 10 errors in 6 files (checked 26 source files)
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @AbhinavTrips @bambriz @pjohari-ms @simorenoh.
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @AbhinavTrips @bambriz @pjohari-ms @simorenoh.
ACTION NEEDED: This version of mypy will be merged on 2025-01-13. The build will begin to fail for this library if errors are not fixed.
Library name: azure-cosmos Mypy version: 1.13.0 Mypy errors: Link to build (2024-11-24) How to fix: Run the
next-mypy
tox command at the library package-level and resolve the typing errors. 1)../azure-cosmos>pip install "tox<5"
2)../azure-cosmos>tox run -e next-mypy -c ../../../eng/tox/tox.ini --root .
See the Typing Guide for more information.