From 71fdbe457889dd4bd090587d017bfc9fda59fa08 Mon Sep 17 00:00:00 2001 From: Trey Spiller Date: Wed, 29 May 2024 15:46:47 -0500 Subject: [PATCH] Fix(motherduck): filter on catalog name in DuckDB _get_data_objects query (#2699) --- sqlmesh/core/engine_adapter/duckdb.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sqlmesh/core/engine_adapter/duckdb.py b/sqlmesh/core/engine_adapter/duckdb.py index db9a8e72c..744c25d38 100644 --- a/sqlmesh/core/engine_adapter/duckdb.py +++ b/sqlmesh/core/engine_adapter/duckdb.py @@ -94,7 +94,9 @@ def _get_data_objects( .as_("type"), ) .from_(exp.to_table("information_schema.tables")) - .where(exp.column("table_schema").eq(schema_name)) + .where( + exp.column("table_catalog").eq(catalog), exp.column("table_schema").eq(schema_name) + ) ) if object_names: query = query.where(exp.column("table_name").isin(*object_names))