Skip to content

Commit b6b571b

Browse files
authored
Merge pull request #16 from trouze/feat/cll-impact
chore(lineage): add fail on impact to non-cross project check
2 parents 553e644 + 6a97f03 commit b6b571b

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

src/cli/commands/lineage.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,18 @@ pub async fn exec(
228228
}
229229

230230
if *fail_on_impact {
231-
let has_consumers = report["summary"]["cross_project_consumers"]
232-
.as_array()
233-
.map_or(false, |a| !a.is_empty());
234-
if has_consumers {
231+
let should_fail = if effective_cross_project {
232+
// Cross-project mode: only fail when confirmed consumers are found.
233+
report["summary"]["cross_project_consumers"]
234+
.as_array()
235+
.map_or(false, |a| !a.is_empty())
236+
} else {
237+
// No cross-project lookup: fail if any columns land in a public model.
238+
report["summary"]["total_impacts"]
239+
.as_u64()
240+
.map_or(false, |n| n > 0)
241+
};
242+
if should_fail {
235243
return Err(DbtpError::ImpactFound(report));
236244
}
237245
}

0 commit comments

Comments
 (0)