mirror of
https://github.com/lancedb/lancedb.git
synced 2026-01-06 20:02:58 +00:00
fix: open table with namespace fails with 'not found' due to URI concatenation
This commit is contained in:
@@ -476,10 +476,16 @@ class LanceNamespaceDBConnection(DBConnection):
|
|||||||
storage_options_provider: Optional[StorageOptionsProvider] = None,
|
storage_options_provider: Optional[StorageOptionsProvider] = None,
|
||||||
index_cache_size: Optional[int] = None,
|
index_cache_size: Optional[int] = None,
|
||||||
) -> LanceTable:
|
) -> 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
|
# Open a table directly from a URI using the location parameter
|
||||||
# Note: storage_options should already be merged by the caller
|
# Note: storage_options should already be merged by the caller
|
||||||
temp_conn = LanceDBConnection(
|
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,
|
read_consistency_interval=self.read_consistency_interval,
|
||||||
storage_options=storage_options if storage_options is not None else {},
|
storage_options=storage_options if storage_options is not None else {},
|
||||||
session=self.session,
|
session=self.session,
|
||||||
@@ -496,7 +502,6 @@ class LanceNamespaceDBConnection(DBConnection):
|
|||||||
location=table_uri,
|
location=table_uri,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def connect_namespace(
|
def connect_namespace(
|
||||||
impl: str,
|
impl: str,
|
||||||
properties: Dict[str, str],
|
properties: Dict[str, str],
|
||||||
|
|||||||
Reference in New Issue
Block a user