Skip to content

Mypy: Syntax errors #20157

Description

By mistake, we started using the prerelease version 12.9.0b1 of azure-storage-blob in our CI.

This resulted in these syntax errors from mypy:

/opt/hostedtoolcache/Python/3.8.10/x64/lib/python3.8/site-packages/azure_storage_blob-12.9.0b1-py3.8.egg/azure/storage/blob/_serialize.py:46: error: Type signature has too few arguments [syntax]
/opt/hostedtoolcache/Python/3.8.10/x64/lib/python3.8/site-packages/azure_storage_blob-12.9.0b1-py3.8.egg/azure/storage/blob/_serialize.py:129: error: Type signature has too few arguments [syntax]
/opt/hostedtoolcache/Python/3.8.10/x64/lib/python3.8/site-packages/azure_storage_blob-12.9.0b1-py3.8.egg/azure/storage/blob/_blob_client.py:1408: error: Type signature has too few arguments [syntax]
/opt/hostedtoolcache/Python/3.8.10/x64/lib/python3.8/site-packages/azure_storage_blob-12.9.0b1-py3.8.egg/azure/storage/blob/_blob_client.py:1448: error: Type signature has too few arguments [syntax]

If you check the code at those locations, they are obviously wrong as the number of arguments in the type annotation does not match the number of arguments in the definition.

To avoid these mistakes in future, I'd suggest using the common-practice inline annotations, which would make it impossible to make this mistake:

def get_modify_conditions(kwargs: Dict[str, object]) -> ModifiedAccessConditions:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

ClientThis issue points to a problem in the data-plane of the library.Service AttentionWorkflow: This issue is responsible by Azure service team.StorageStorage Service (Queues, Blobs, Files)customer-reportedIssues that are reported by GitHub users external to the Azure organization.feature-requestThis issue requires a new behavior in the product in order be resolved.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions