File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -206,6 +206,16 @@ def _adls(properties: Properties) -> AbstractFileSystem:
206206 from azure .core .credentials import AccessToken
207207 from azure .core .credentials_async import AsyncTokenCredential
208208
209+ # Monkeypatch AzureBlobFileSystem._strip_protocol function
210+ # adlfs expects abfs/abfss. For compatibility, convert wasb/wasbs to abfs/abfss
211+ _original_strip_protocol = AzureBlobFileSystem ._strip_protocol
212+
213+ def strip_protocol_patch (cls , path : str ): # type: ignore
214+ path = path .replace ("wasb://" , "abfs://" ).replace ("wasbs://" , "abfss://" )
215+ return _original_strip_protocol (path )
216+
217+ AzureBlobFileSystem ._strip_protocol = classmethod (strip_protocol_patch )
218+
209219 for key , sas_token in {
210220 key .replace (f"{ ADLS_SAS_TOKEN } ." , "" ): value for key , value in properties .items () if key .startswith (ADLS_SAS_TOKEN )
211221 }.items ():
You can’t perform that action at this time.
0 commit comments