Repository: fsspec/adlfs (language: python)

Issue:
ls does not work with protocol prefix
Many commands seem to work with a protocol prefix as they call `_strip_protocol` internally however ls doesn't seem to work for ls. It seems consistent with s3fs and gcsfs that this is supported as well by adlfs.


Discussion / hints:

Fix patch:
diff --git a/adlfs/spec.py b/adlfs/spec.py
index 8fff33e6..256c8531 100644
--- a/adlfs/spec.py
+++ b/adlfs/spec.py
@@ -787,7 +787,7 @@ async def _ls(
 
         """
         logger.debug("abfs.ls() is searching for %s", path)
-        target_path = path.strip("/")
+        target_path = self._strip_protocol(path).strip("/")
         container, path, path_version_id = self.split_path(path)
         version_id = _coalesce_version_id(version_id, path_version_id)
 


Test patch:
diff --git a/adlfs/tests/test_spec.py b/adlfs/tests/test_spec.py
index 87e00d65..5bb794c6 100644
--- a/adlfs/tests/test_spec.py
+++ b/adlfs/tests/test_spec.py
@@ -122,6 +122,8 @@ def test_ls(storage):
         "data/root/e+f/file1.txt",
         "data/root/e+f/file2.txt",
     ]
+    # Ensure ls works with protocol prefix
+    assert fs.ls("data/root/e+f/") == fs.ls("abfs://data/root/e+f/")
 
     # file details
     files = fs.ls("data/root/a/file.txt", detail=True)