Fixing Default Azure Credential bug in Windows throwing NotImplementedError#328
Merged
hayesgb merged 13 commits intofsspec:mainfrom Jul 22, 2022
Merged
Fixing Default Azure Credential bug in Windows throwing NotImplementedError#328hayesgb merged 13 commits intofsspec:mainfrom
hayesgb merged 13 commits intofsspec:mainfrom
Conversation
added 12 commits
June 29, 2022 13:43
Contributor
Author
|
My PR is only failing at linting test, and I cannot understand why is it failing. |
Collaborator
|
I suspect the linter is complaining b/c of the single linespace after the new function in |
hayesgb
approved these changes
Jul 22, 2022
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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