sql("...") or python("hook_name").
SQL hooks
--no-sql-validation must be absent, and the effective project or model sql_validation value must be true.
Python hooks
SQLBuild discovers@hook functions recursively under hooks/:
Hook context
Python hooks declare aHookContext parameter named ctx, context, _ctx, or hook_context. It need not be the first parameter when providers or configured arguments are also present:
Providers may also be injected into hook parameters by name.
Skip timing
Returningctx.skip(...) from a pre-hook prevents materialization. Returning it from a post-hook changes the reported execution result, but the relation has already been created, promoted, or incrementally updated and audited.
mode="hard" blocks downstream nodes. A soft skip does not automatically block every downstream node; scheduler propagation depends on the other upstream results.
Failure timing
Post-hooks are not promotion gates. A failed post-hook marks the model run as failed after warehouse mutation has already occurred. Put logic that must prevent materialization in a pre-hook, contract, pre-promotion audit, or the materialization itself.Discovery and validation
- Files beginning with
_, including__init__.py, are skipped. - Hook names must be unique across the project.
- The decorator accepts optional
nameanddescriptionarguments. - Unknown hooks, unknown keyword arguments, and missing required arguments fail compilation.
- A function without
**kwargsrejects undeclared hook arguments.

