Skip to content

Commit

Permalink
style: fix mypy failure
Browse files Browse the repository at this point in the history
  • Loading branch information
Lee-W committed Jul 13, 2023
1 parent 3c032c9 commit ad0706f
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions astronomer/providers/microsoft/azure/hooks/wasb.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
"""This module contains the Azure WASB hook's asynchronous implementation."""
from typing import Any, List, Optional, Union
from __future__ import annotations

from typing import Any, Union

from airflow.providers.microsoft.azure.hooks.wasb import WasbHook
from azure.core.exceptions import ResourceNotFoundError
from azure.identity.aio import ClientSecretCredential, DefaultAzureCredential
from azure.storage.blob._models import BlobProperties
from azure.storage.blob.aio import BlobClient, BlobServiceClient, ContainerClient

Credentials = Union[ClientSecretCredential, DefaultAzureCredential]
Expand Down Expand Up @@ -55,9 +56,7 @@ def get_conn(self) -> BlobServiceClient:
app_id = conn.login
app_secret = conn.password
token_credential = ClientSecretCredential(tenant, app_id, app_secret)
return BlobServiceClient(
account_url=conn.host, credential=token_credential, **extra # type:ignore[arg-type]
)
return BlobServiceClient(account_url=conn.host, credential=token_credential, **extra)

sas_token = extra.pop("sas_token", extra.pop("extra__wasb__sas_token", None))
if sas_token:
Expand Down Expand Up @@ -113,11 +112,11 @@ def _get_container_client(self, container_name: str) -> ContainerClient:
async def get_blobs_list_async(
self,
container_name: str,
prefix: Optional[str] = None,
include: Optional[List[str]] = None,
prefix: str | None = None,
include: list[str] | None = None,
delimiter: str = "/",
**kwargs: Any,
) -> List[BlobProperties]:
) -> list[str]:
"""
List blobs in a given container.
Expand Down

0 comments on commit ad0706f

Please sign in to comment.