Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DefaultAzureCredential authentication path throws NotImplementedError on Windows 10 #270

Open
edwardlonghurst opened this issue Aug 26, 2021 · 2 comments

Comments

@edwardlonghurst
Copy link

What happened:
On Windows 10:
Including 'anon':False in the storage_options throws NotImplementedError on asyncio.get_child_watcher().attach_loop(self.loop)

What you expected to happen:
DefaultAzureCredentials are used to authenticate

Minimal Complete Verifiable Example:
On Windows 10:

import pandas as pd
url = "abfs://..."
pd.read_parquet(url, storage_options={"anon":False, "account_name":"..."})

Anything else we need to know?:
Providing the credentials directly (thus avoiding the call to get_child_watcher) works fine:

from azure.identity.aio import DefaultAzureCredential as AIODefaultAzureCredential
import pandas as pd
url = "abfs://..."
pd.read_parquet(url, storage_options={"anon":False, "account_name":"...", 'credential':AIODefaultAzureCredential()})

Environment:

  • Dask version: 2021.8,1
  • adlfs version: 2021.8.2
  • fsspec version: 2021.7.0
  • Python version: 3.8.8
  • Operating System: Windows 10
  • Install method (conda, pip, source): pip
@gabrieldaiha
Copy link
Contributor

Man, I've faced the same problem here.

My workaround was (you can see it in my fork, i'm preparing it for PR):

In get_default_azure_credential, I removed the asyncio part (Windows does not have get_child_watcher implemented, this function is Unix only):

https://github.com/gabrieldaiha/adlfs/blob/9d5283f5630e500f71d1ab91e7cc24e8c6592afb/adlfs/spec.py#L532-L539

I moved the get_default_azure_credential call from do_connect function to the init function, like get_service_principal_credential does.
I added a new weakref.finalize to async credentials too, in order to avoid Unclosed Client Session ERROR in the exit of the program

https://github.com/gabrieldaiha/adlfs/blob/9d5283f5630e500f71d1ab91e7cc24e8c6592afb/adlfs/spec.py#L455-L466

@PeterFogh
Copy link
Contributor

PeterFogh commented Nov 29, 2022

I think this issue is fixed by #328, thus it can be closed. And the comment about the issue can be removed from

# Solving issue in https://github.com/fsspec/adlfs/issues/270

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants