1. A data platform team wants to publish a stable, versioned public interface for `fct_orders` so that downstream consumers in other dbt projects are protected from accidental breaking changes. They set `access: public` and `contract: {enforced: true}` on the model, and define explicit column names and data types in the YAML. A junior engineer then opens a PR that renames a column in `fct_orders.sql` from `order_total` to `total_order_amount` but does NOT update the YAML contract. What will happen when dbt compiles this model, and why?
- A. dbt will raise a contract violation error at compile time because the compiled model's output columns no longer match the columns declared in the enforced contract, preventing the run from proceeding.✓ Correct
- B. dbt will issue a warning but still compile and run the model successfully, because contract enforcement only blocks deployment in production environments.
- C. dbt will silently succeed at compile time but raise a schema test failure at run time when the `not_null` or `accepted_values` tests detect the missing column.
- D. dbt will raise an error only if the model is referenced by a cross-project `ref()`, because contract enforcement is only triggered for public models consumed outside the current project.
Explanation
When `contract: {enforced: true}` is set, dbt validates at **compile time** that the model's SQL produces columns that exactly match the names and data types declared in the YAML. Renaming a column without updating the contract causes an immediate compile-time error — the run never executes. Option B is incorrect: contract enforcement is not environment-scoped; it applies in any environment where dbt compiles the model. Option C is incorrect: contract violations are not surfaced through schema tests — they are a separate compile-time check independent of tests. Option D is incorrect: contract enforcement is triggered whenever the model is compiled, regardless of whether it is consumed by a cross-project `ref()`; the `access: public` setting controls discoverability and cross-project referencing, but contract enforcement is separate and always active when `enforced: true`.