Skip to content

Typing error with  #34744

@pamelafox

Description

@pamelafox
  • Package Name: azure-keyvault-secrets
  • Package Version:
  • Operating System:
  • Python Version:

Describe the bug

Starting with this code:

from azure.keyvault.secrets.aio import SecretClient

async with SecretClient(
    vault_url=f"https://{key_vault_name}.vault.azure.net", credential=azure_credential
) as key_vault_client:
    search_key = (await key_vault_client.get_secret(search_secret_name)).value

Then running "python -m mypy", we get this typing error:

error: "AsyncKeyVaultClientBase" has no attribute "get_secret" [attr-defined]

The error only happens when I use it as an async context manager.

Metadata

Metadata

Assignees

Labels

ClientThis issue points to a problem in the data-plane of the library.KeyVaultbugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.mypyneeds-team-attentionWorkflow: This issue needs attention from Azure service team or SDK team

Type

No type

Projects

Status

No status

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions