From 6c26cf7cdd7fc7ccc3d9eabe3a538f8b152757b3 Mon Sep 17 00:00:00 2001 From: dberenbaum Date: Wed, 19 Jul 2023 11:42:56 -0400 Subject: [PATCH] ls raises error if passed a file --- src/dvc_data/fs.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/dvc_data/fs.py b/src/dvc_data/fs.py index 72579aae..49a5b047 100644 --- a/src/dvc_data/fs.py +++ b/src/dvc_data/fs.py @@ -95,11 +95,7 @@ def ls(self, path, detail=True, **kwargs): try: info = self.index.info(root_key) if info["type"] != "directory": - if detail: - info["name"] = path - return [info] - else: - return [path] + raise NotADirectoryError(path) if not detail: return [