File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -197,12 +197,14 @@ def _adls(properties: Properties) -> AbstractFileSystem:
197197 from adlfs import AzureBlobFileSystem
198198
199199 # https://learn.microsoft.com/en-us/azure/storage/blobs/data-lake-storage-introduction-abfs-uri#uri-syntax
200+ account_uri = None
200201 if not properties .get (ADLS_ACCOUNT_NAME ) and (netloc := properties .get ("netloc" )):
201- properties [ADLS_ACCOUNT_NAME ] = netloc .split ("@" )[- 1 ].split ("." )[0 ]
202+ account_uri = netloc .split ("@" )[- 1 ]
203+ properties [ADLS_ACCOUNT_NAME ] = account_uri .split ("." )[0 ]
202204
203205 # Fixes https://github.com/apache/iceberg-python/issues/1146
204- if properties . get ( ADLS_ACCOUNT_NAME ) and not properties .get (ADLS_SAS_TOKEN ):
205- properties [ADLS_SAS_TOKEN ] = properties .get (f"{ ADLS_SAS_TOKEN } .{ ADLS_ACCOUNT_NAME } .dfs.core.windows.net " )
206+ if not properties .get (ADLS_SAS_TOKEN ) and account_uri :
207+ properties [ADLS_SAS_TOKEN ] = properties .get (f"{ ADLS_SAS_TOKEN } .{ account_uri } " )
206208
207209 return AzureBlobFileSystem (
208210 connection_string = properties .get (ADLS_CONNECTION_STRING ),
You can’t perform that action at this time.
0 commit comments