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 14, 2023
1 parent fedc81f commit 76198d1
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions astronomer/providers/microsoft/azure/hooks/wasb.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""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
Expand Down Expand Up @@ -55,9 +57,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 +113,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[BlobProperties]:
"""
List blobs in a given container.
Expand All @@ -130,10 +130,10 @@ async def get_blobs_list_async(
:param delimiter: filters objects based on the delimiter (for e.g '.csv')
"""
container = self._get_container_client(container_name)
blob_list = []
blob_list: list[BlobProperties] = []
blobs = container.walk_blobs(name_starts_with=prefix, include=include, delimiter=delimiter, **kwargs)
async for blob in blobs:
blob_list.append(blob.name)
blob_list.append(blob)
return blob_list

async def check_for_prefix_async(self, container_name: str, prefix: str, **kwargs: Any) -> bool:
Expand Down

0 comments on commit 76198d1

Please sign in to comment.