From 15fbcf61fcd4b12050c798552058c552e7de8c3e Mon Sep 17 00:00:00 2001 From: Jack Ye Date: Fri, 17 Apr 2026 09:58:00 -0700 Subject: [PATCH] fix(python): use declared location for namespace table open --- python/python/lancedb/namespace.py | 37 ++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/python/python/lancedb/namespace.py b/python/python/lancedb/namespace.py index 0996c63fd..018e4fdea 100644 --- a/python/python/lancedb/namespace.py +++ b/python/python/lancedb/namespace.py @@ -578,13 +578,18 @@ class LanceNamespaceDBConnection(DBConnection): on_bad_vectors=on_bad_vectors, fill_value=fill_value, embedding_functions=embedding_functions, - namespace_path=namespace_path, + namespace_path=[], storage_options=merged_storage_options, location=location, namespace_client=self._namespace_client, pushdown_operations=self._namespace_client_pushdown_operations, ) + tbl._namespace_path = namespace_path + tbl._location = location + tbl._namespace_client = self._namespace_client + tbl._pushdown_operations = self._namespace_client_pushdown_operations + return tbl def _create_table_server_side( @@ -914,18 +919,24 @@ class LanceNamespaceDBConnection(DBConnection): # storage options provider # Pass managed_versioning to avoid redundant describe_table call # Pass pushdown_operations if configured on this connection - return LanceTable.open( + table = LanceTable.open( temp_conn, name, - namespace_path=namespace_path, + namespace_path=[], storage_options=storage_options, index_cache_size=index_cache_size, location=table_uri, - namespace_client=namespace_client, - managed_versioning=managed_versioning, + namespace_client=None, + managed_versioning=False, pushdown_operations=self._namespace_client_pushdown_operations, ) + table._namespace_path = namespace_path + table._location = table_uri + table._namespace_client = namespace_client + table._pushdown_operations = self._namespace_client_pushdown_operations + return table + @override def namespace_client(self) -> LanceNamespace: """Get the namespace client for this connection. @@ -1120,7 +1131,7 @@ class AsyncLanceNamespaceDBConnection: on_bad_vectors=on_bad_vectors, fill_value=fill_value, embedding_functions=embedding_functions, - namespace_path=namespace_path, + namespace_path=[], storage_options=merged_storage_options, location=location, namespace_client=self._namespace_client, @@ -1222,18 +1233,24 @@ class AsyncLanceNamespaceDBConnection: session=self.session, ) - return LanceTable.open( + table = LanceTable.open( temp_conn, name, - namespace_path=namespace_path, + namespace_path=[], storage_options=merged_storage_options, index_cache_size=index_cache_size, location=response.location, - namespace_client=self._namespace_client, - managed_versioning=managed_versioning, + namespace_client=None, + managed_versioning=False, pushdown_operations=self._namespace_client_pushdown_operations, ) + table._namespace_path = namespace_path + table._location = response.location + table._namespace_client = self._namespace_client + table._pushdown_operations = self._namespace_client_pushdown_operations + return table + lance_table = await asyncio.to_thread(_open_table) return lance_table._table