Skip to content

Fixing Default Azure Credential bug in Windows throwing NotImplementedError#328

Merged
hayesgb merged 13 commits intofsspec:mainfrom
gabrieldaiha:master
Jul 22, 2022
Merged

Fixing Default Azure Credential bug in Windows throwing NotImplementedError#328
hayesgb merged 13 commits intofsspec:mainfrom
gabrieldaiha:master

Conversation

@gabrieldaiha
Copy link
Contributor

This pull request aims to solve the #270 issue about throwing NotImplementedError when trying to use anon=False in Windows.
This error occurs because asyncio.get_child_watcher is Unix only.

The workaround was:

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/223d6683e35757b25671b42dd7cfdc67df08df18/adlfs/spec.py#L531-L548

I moved the get_default_azure_credential call from do_connect function to the init function, like get_service_principal_credential does. Finally, 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/223d6683e35757b25671b42dd7cfdc67df08df18/adlfs/spec.py#L454-L465

@gabrieldaiha
Copy link
Contributor Author

gabrieldaiha commented Jun 30, 2022

My PR is only failing at linting test, and I cannot understand why is it failing.

@hayesgb
Copy link
Collaborator

hayesgb commented Jul 9, 2022

I suspect the linter is complaining b/c of the single linespace after the new function in utils.py, but you should be able to run pre-commit run --all-files to fix the lint issues.

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

Successfully merging this pull request may close these issues.

2 participants