From 1fc442b3feb8b280c1fcd6354de87582c7b24d65 Mon Sep 17 00:00:00 2001 From: dal Date: Tue, 3 Jun 2025 16:47:23 -0600 Subject: [PATCH] hotfix: wildcard matching on cli generate --- cli/cli/src/commands/generate.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cli/cli/src/commands/generate.rs b/cli/cli/src/commands/generate.rs index a7497b939..ddf18f09f 100644 --- a/cli/cli/src/commands/generate.rs +++ b/cli/cli/src/commands/generate.rs @@ -349,6 +349,14 @@ for (unique_id, node) in &dbt_catalog.nodes { } } + // Try wildcard lookup: find any key ending with .model_name + let model_suffix = format!(".{}", model_name); + for (key, &node) in lookup { + if key.ends_with(&model_suffix) { + return Some((node, "wildcard match".to_string(), key.clone())); + } + } + // Fallback to simple name lookup lookup.get(model_name).map(|&node| (node, "simple name".to_string(), model_name.to_string())