apply_cleansing_plan
Validate and apply a data-cleansing plan. THIS CHANGES REAL DATA in the model's current physical snapshot table. Requires confirm=true.
Instructions
Validate and apply a data-cleansing plan. THIS CHANGES REAL DATA in the model's current physical snapshot table. Requires confirm=true.
Default mode: pass plan directly, built from propose_cleansing_plan's
output -- validated against the operation vocabulary and the model's
schema before any step runs, same as always.
If this server requires plan approval (DATAVEIL_REQUIRE_PLAN_APPROVAL=
true): pass plan_id instead, from a plan that was registered
(register_cleansing_plan) and then approved (approve_cleansing_plan) by
someone else. confirm=true is still required on top of that approval,
not instead of it.
Note: this writes directly to the model's physical table, outside SQLMesh's own state tracking. A FULL-kind model is fully rematerialized on its next scheduled run/plan apply, which will silently undo the cleansing -- it was never folded into the model's SQL definition. Re-apply after any such rerun if the cleansing still applies.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| plan | No | ||
| confirm | No | ||
| plan_id | No | ||
| model_name | Yes |