Skip to content

Clarify async credential requirement and update examples#537

Merged
kyleknap merged 8 commits intofsspec:mainfrom
nateprewitt:handle_sync_creds
Mar 9, 2026
Merged

Clarify async credential requirement and update examples#537
kyleknap merged 8 commits intofsspec:mainfrom
nateprewitt:handle_sync_creds

Conversation

@nateprewitt
Copy link
Collaborator

adlfs uses the async Azure SDK under the hood, which requires async credentials. A common source of issues is users passing synchronous credentials (e.g. azure.identity.DefaultAzureCredential) instead of their async counterparts (azure.identity.aio.DefaultAzureCredential). This was partly due to inaccurate documentation in the project which should now be fixed.

For almost all users, the preferred option is to use anon=False (soon to be default) when instantiating your file system. This allows the SDK to auto-detect the right credentials. If you must supply credentials directly, make sure you're using the async version.

This PR:

  • Emits a FutureWarning when synchronous credentials are detected
  • Adds a CredentialType alias for accurate type checking
  • Updates docs and README to recommend anon=False over passing credential objects directly, and corrects references to point to azure.identity.aio

Copy link
Collaborator

@anjaliratnam-msft anjaliratnam-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me!

Copy link
Collaborator

@kyleknap kyleknap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just had a couple of small comments. I think it is worth calling out the fix for close() in the changelog too.

Copy link
Collaborator

@kyleknap kyleknap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! 🚢

@kyleknap kyleknap merged commit 06556c3 into fsspec:main Mar 9, 2026
8 checks passed
@nateprewitt nateprewitt deleted the handle_sync_creds branch March 9, 2026 22:27
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.

3 participants