From ef1e899e8fb76084d5a3acce3b8f03701caa8aa6 Mon Sep 17 00:00:00 2001 From: Simon Lin Date: Fri, 20 Dec 2024 22:22:50 +1100 Subject: [PATCH] c --- py-polars/polars/io/cloud/credential_provider.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/py-polars/polars/io/cloud/credential_provider.py b/py-polars/polars/io/cloud/credential_provider.py index f52a28e3992b..e851a76ae958 100644 --- a/py-polars/polars/io/cloud/credential_provider.py +++ b/py-polars/polars/io/cloud/credential_provider.py @@ -179,12 +179,11 @@ def __init__( self._check_module_availability() - from azure.identity import ( - DefaultAzureCredential, # type: ignore[import-not-found] - ) - self.account_name = storage_account - self.credential = DefaultAzureCredential() + # Done like this to bypass mypy, we don't have stubs for azure.identity + self.credential = importlib.import_module("azure.identity").__dict__[ + "DefaultAzureCredential" + ]() self.scopes = scopes if scopes is not None else ["https://storage.azure.com/"] self._verbose = _verbose