From 1d8c2a0a6fb53d9dcd163aefedd5294155ba0881 Mon Sep 17 00:00:00 2001 From: Wyatt Alt Date: Sat, 15 Aug 2026 01:08:59 -0700 Subject: [PATCH] test: pin the custom-location creation path; scope the overview to what ships The reopen-failure arm of canonicalization had no direct regression: a fallback to the caller handle would revive the bug unseen. The module doc also named a refresh method this layer does not define. --- rust/lancedb/src/materialized_view.rs | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/rust/lancedb/src/materialized_view.rs b/rust/lancedb/src/materialized_view.rs index c612fdac0..7231edf80 100644 --- a/rust/lancedb/src/materialized_view.rs +++ b/rust/lancedb/src/materialized_view.rs @@ -7,7 +7,7 @@ //! over one source table -- projected expressions, an optional filter, an //! optional row limit -- and maintained by refresh rather than by writes. //! Creating one commits an empty table carrying the definition in schema -//! metadata; [`MaterializedView::refresh`] computes the rows. The source +//! metadata; a later refresh computes the rows. The source //! table must have stable row ids ([`CreateMaterializedViewBuilder::execute`] //! says why). //! @@ -1278,6 +1278,24 @@ mod tests { "{err}" ); + // A table created at a custom location is refused outright: its + // recorded name reaches nothing at the database root, so the + // canonical reopen fails before any URI comparison. + let custom = conn + .create_table( + "custom_loc", + record_batch!(("id", Int32, [1, 2]), ("value", Int32, [3, 4])).unwrap(), + ) + .location("memory://elsewhere/custom_loc") + .write_options(stable_row_ids()) + .execute() + .await + .unwrap(); + let err = prepare_declaration(&custom, &[], None, None) + .await + .unwrap_err(); + assert!(err.to_string().contains("custom_loc"), "{err}"); + // A namespaced source cannot be recorded in the definition: the // bare name refresh resolves would reach a different table or none. let namespaced = crate::table::NativeTable::create(