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

Fixing Default Azure Credential bug in Windows throwing NotImplementedError #328

Merged
merged 13 commits into from
Jul 22, 2022

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