From a86bc051315fc68b571ff97b4396c306ccd2e1ff Mon Sep 17 00:00:00 2001 From: Lei Xu Date: Tue, 18 Jul 2023 08:45:10 -0700 Subject: [PATCH] [Bug] Fix dataset path check in Table::open (#326) Fixed a bug that prevents to open remote tables. --- python/lancedb/table.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/lancedb/table.py b/python/lancedb/table.py index d2fa3d0f..e2b3fec1 100644 --- a/python/lancedb/table.py +++ b/python/lancedb/table.py @@ -534,7 +534,9 @@ class LanceTable(Table): @classmethod def open(cls, db, name): tbl = cls(db, name) - if not os.path.exists(tbl._dataset_uri): + fs, path = pa.fs.FileSystem.from_uri(tbl._dataset_uri) + file_info = fs.get_file_info(path) + if file_info.type != pa.fs.FileType.Directory: raise FileNotFoundError( f"Table {name} does not exist. Please first call db.create_table({name}, data)" )