From 6aa33c36580f9acb7aaec36f1548014fc119c4f4 Mon Sep 17 00:00:00 2001 From: Ryan Green Date: Tue, 18 Nov 2025 09:28:23 -0330 Subject: [PATCH] fix: open table with namespace fails with 'not found' due to URI concatenation --- python/python/lancedb/namespace.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/python/python/lancedb/namespace.py b/python/python/lancedb/namespace.py index 0825a3cc..e41b0ee9 100644 --- a/python/python/lancedb/namespace.py +++ b/python/python/lancedb/namespace.py @@ -476,10 +476,16 @@ class LanceNamespaceDBConnection(DBConnection): storage_options_provider: Optional[StorageOptionsProvider] = None, index_cache_size: Optional[int] = None, ) -> LanceTable: + # parse the DB location from the table URI + if table_uri.endswith(f"/{name}.lance"): + db_uri = table_uri[: -len(f"/{name}.lance")] + else: + db_uri = table_uri + # Open a table directly from a URI using the location parameter # Note: storage_options should already be merged by the caller temp_conn = LanceDBConnection( - table_uri, # Use the table location as the connection URI + db_uri, # Use the table location as the connection URI read_consistency_interval=self.read_consistency_interval, storage_options=storage_options if storage_options is not None else {}, session=self.session, @@ -496,7 +502,6 @@ class LanceNamespaceDBConnection(DBConnection): location=table_uri, ) - def connect_namespace( impl: str, properties: Dict[str, str],