This is an automated email from the ASF dual-hosted git repository. kevinjqliu pushed a commit to branch christophediprima/main in repository https://gitbox.apache.org/repos/asf/iceberg-python.git
commit 40ebe66ab9f509f9d5d5fc01f2990fe31878efa4 Author: Kevin Liu <[email protected]> AuthorDate: Thu Aug 28 14:03:17 2025 -0700 monkeypatch AzureBlobFileSystem._strip_protocol --- pyiceberg/io/fsspec.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pyiceberg/io/fsspec.py b/pyiceberg/io/fsspec.py index 4a6db906..04cf9f17 100644 --- a/pyiceberg/io/fsspec.py +++ b/pyiceberg/io/fsspec.py @@ -250,6 +250,16 @@ def _adls(properties: Properties) -> AbstractFileSystem: from azure.core.credentials import AccessToken from azure.core.credentials_async import AsyncTokenCredential + # Monkeypatch AzureBlobFileSystem._strip_protocol function + # adlfs expects abfs/abfss. For compatibility, convert wasb/wasbs to abfs/abfss + _original_strip_protocol = AzureBlobFileSystem._strip_protocol + + def strip_protocol_patch(cls, path: str): # type: ignore + path = path.replace("wasb://", "abfs://").replace("wasbs://", "abfss://") + return _original_strip_protocol(path) + + AzureBlobFileSystem._strip_protocol = classmethod(strip_protocol_patch) + for key, sas_token in { key.replace(f"{ADLS_SAS_TOKEN}.", ""): value for key, value in properties.items() if key.startswith(f"{ADLS_SAS_TOKEN}.") }.items():
