@@ -200,6 +200,7 @@ def evaluate(
200200 allow_destructive_snapshots : t .Optional [t .Set [str ]] = None ,
201201 allow_additive_snapshots : t .Optional [t .Set [str ]] = None ,
202202 target_table_exists : t .Optional [bool ] = None ,
203+ skip_audits : bool = False ,
203204 ** kwargs : t .Any ,
204205 ) -> t .List [AuditResult ]:
205206 """Evaluate a snapshot and add the processed interval to the state sync.
@@ -239,17 +240,19 @@ def evaluate(
239240 target_table_exists = target_table_exists ,
240241 ** kwargs ,
241242 )
242- audit_results = self ._audit_snapshot (
243- snapshot = snapshot ,
244- environment_naming_info = environment_naming_info ,
245- start = start ,
246- end = end ,
247- execution_time = execution_time ,
248- snapshots = snapshots ,
249- deployability_index = deployability_index ,
250- wap_id = wap_id ,
251- ** kwargs ,
252- )
243+ audit_results : t .List [AuditResult ] = []
244+ if not skip_audits :
245+ audit_results = self ._audit_snapshot (
246+ snapshot = snapshot ,
247+ environment_naming_info = environment_naming_info ,
248+ start = start ,
249+ end = end ,
250+ execution_time = execution_time ,
251+ snapshots = snapshots ,
252+ deployability_index = deployability_index ,
253+ wap_id = wap_id ,
254+ ** kwargs ,
255+ )
253256
254257 self .state_sync .add_interval (
255258 snapshot , start , end , is_dev = not is_deployable , last_altered_ts = now_timestamp ()
@@ -272,6 +275,7 @@ def run(
272275 deployability_index : t .Optional [DeployabilityIndex ] = None ,
273276 auto_restatement_enabled : bool = False ,
274277 run_environment_statements : bool = False ,
278+ skip_audits : bool = False ,
275279 ) -> CompletionStatus :
276280 return self ._run_or_audit (
277281 environment = environment ,
@@ -288,6 +292,7 @@ def run(
288292 deployability_index = deployability_index ,
289293 auto_restatement_enabled = auto_restatement_enabled ,
290294 run_environment_statements = run_environment_statements ,
295+ skip_audits = skip_audits ,
291296 )
292297
293298 def audit (
@@ -304,7 +309,11 @@ def audit(
304309 circuit_breaker : t .Optional [t .Callable [[], bool ]] = None ,
305310 deployability_index : t .Optional [DeployabilityIndex ] = None ,
306311 run_environment_statements : bool = False ,
312+ skip_audits : bool = False ,
307313 ) -> CompletionStatus :
314+ if skip_audits :
315+ return CompletionStatus .SUCCESS
316+
308317 # Remove the intervals from the snapshots that will be audited so that they can be recomputed
309318 # by _run_or_audit as "missing intervals" to reuse the rest of it's logic
310319 remove_intervals = {}
@@ -434,6 +443,7 @@ def run_merged_intervals(
434443 selected_snapshot_ids : t .Optional [t .Set [SnapshotId ]] = None ,
435444 run_environment_statements : bool = False ,
436445 audit_only : bool = False ,
446+ skip_audits : bool = False ,
437447 auto_restatement_triggers : t .Dict [SnapshotId , t .List [SnapshotId ]] = {},
438448 is_restatement : bool = False ,
439449 ) -> t .Tuple [t .List [NodeExecutionFailedError [SchedulingUnit ]], t .List [SchedulingUnit ]]:
@@ -537,15 +547,16 @@ def run_node(node: SchedulingUnit) -> None:
537547 assert deployability_index # mypy
538548
539549 if audit_only :
540- audit_results = self ._audit_snapshot (
541- snapshot = snapshot ,
542- environment_naming_info = environment_naming_info ,
543- deployability_index = deployability_index ,
544- snapshots = self .snapshots_by_name ,
545- start = start ,
546- end = end ,
547- execution_time = execution_time ,
548- )
550+ if not skip_audits :
551+ audit_results = self ._audit_snapshot (
552+ snapshot = snapshot ,
553+ environment_naming_info = environment_naming_info ,
554+ deployability_index = deployability_index ,
555+ snapshots = self .snapshots_by_name ,
556+ start = start ,
557+ end = end ,
558+ execution_time = execution_time ,
559+ )
549560 else :
550561 # If batch_index > 0, then the target table must exist since the first batch would have created it
551562 target_table_exists = (
@@ -563,6 +574,7 @@ def run_node(node: SchedulingUnit) -> None:
563574 allow_additive_snapshots = allow_additive_snapshots ,
564575 target_table_exists = target_table_exists ,
565576 selected_models = selected_models ,
577+ skip_audits = skip_audits ,
566578 )
567579
568580 evaluation_duration_ms = now_timestamp () - execution_start_ts
@@ -785,6 +797,7 @@ def _run_or_audit(
785797 auto_restatement_enabled : bool = False ,
786798 run_environment_statements : bool = False ,
787799 audit_only : bool = False ,
800+ skip_audits : bool = False ,
788801 ) -> CompletionStatus :
789802 """Concurrently runs or audits all snapshots in topological order.
790803
@@ -876,6 +889,7 @@ def _run_or_audit(
876889 end = end ,
877890 run_environment_statements = run_environment_statements ,
878891 audit_only = audit_only ,
892+ skip_audits = skip_audits ,
879893 auto_restatement_triggers = auto_restatement_triggers ,
880894 selected_models = {
881895 s .node .dbt_unique_id for s in merged_intervals if s .node .dbt_unique_id
0 commit comments