feat: record the namespace a view's unqualified names resolve against

A view outlives the session that declared it, so the namespace path its
query resolved against travels with it, beside the database. Without it
a reader would resolve an unqualified name against its own default and
read a different table.

`ViewDescription` carries `default_namespace_path`; it crosses the wire
as `default_namespace`, a path like `namespace`, absent for the root.
This commit is contained in:
Jack Ye
2026-09-22 10:14:49 -07:00
parent 24628a8bb9
commit 151d507f3d
12 changed files with 70 additions and 8 deletions
+2 -1
View File
@@ -106,7 +106,7 @@ fn parse_default_namespace_path(path: Option<Bound<'_, PyAny>>) -> PyResult<Vec<
/// A view description on its way to Python: name, namespace, query, default
/// database, and the schema as pyarrow renders it.
type PyViewDescription = (String, Vec<String>, String, String, Py<PyAny>);
type PyViewDescription = (String, Vec<String>, String, String, Vec<String>, Py<PyAny>);
/// A view description as a plain tuple, with the schema converted to the
/// pyarrow schema the caller would get from any other lancedb API. The Python
@@ -120,6 +120,7 @@ fn view_description_to_py(view: lancedb::view::ViewDescription) -> PyResult<PyVi
view.namespace_path,
view.query,
view.default_database,
view.default_namespace_path,
schema,
))
})