hotfix: wildcard matching on cli generate

This commit is contained in:
dal 2025-06-03 16:47:23 -06:00
parent 1aeec45721
commit 1fc442b3fe
No known key found for this signature in database
GPG Key ID: 16F4B0E1E9F61122
1 changed files with 8 additions and 0 deletions

View File

@ -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())