fix: Extract ADLS account_name from URI hostname in FsspecFileIO#3005
Open
antonlin1 wants to merge 1 commit intoapache:mainfrom
Open
fix: Extract ADLS account_name from URI hostname in FsspecFileIO#3005antonlin1 wants to merge 1 commit intoapache:mainfrom
antonlin1 wants to merge 1 commit intoapache:mainfrom
Conversation
8820970 to
1b6e8b4
Compare
When tables created by Spark/Hadoop store fully-qualified ABFSS URIs (e.g. abfss://container@account.dfs.core.windows.net/path) but catalog properties don't include adls.account-name, FsspecFileIO would create AzureBlobFileSystem with account_name=None. adlfs then strips the URI to container/path via _strip_protocol(), losing the storage account, resulting in FileNotFoundError. The fix extracts account_name from the URI hostname as a fallback in _adls(), after SAS token extraction and explicit property checks, so existing configuration always takes priority. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1b6e8b4 to
fe8232a
Compare
Fokko
approved these changes
Feb 7, 2026
Contributor
Fokko
left a comment
There was a problem hiding this comment.
Looks reasonable, thanks @antonlin1 for adding this 👍
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.
Summary
adls.account-nameis not in catalog/table properties (common for tables created by Spark),FsspecFileIOcreatedAzureBlobFileSystemwithaccount_name=None_strip_protocol()stripsabfss://container@account.dfs.core.windows.net/pathtocontainer/path, losing the storage account info, causingFileNotFoundErroraccount_namefrom the URI hostname as a last-resort fallback in_adls(), after SAS token extraction and explicit property checksPriority order for account_name resolution:
adls.account-namepropertyusagestorageprod.dfs.core.windows.net→usagestorageprod)Test plan
test_adls_account_name_extracted_from_uri_hostname— verifies account extraction from full ABFSS URItest_adls_account_name_not_overridden_when_in_properties— verifies explicit property takes prioritytest_adls_account_name_sas_token_extractionstill passes (SAS token takes priority over hostname)🤖 Generated with Claude Code