QuestionQ56

Verified

Your model has a contract on it.

When you rename a field, you receive this error:

This model has an enforced contract that failed.

Please ensure the name, data_type, and number of columns in your contract match the columns in your model's definition.

| column_name | definition_type | contract_type | mismatch_reason |

|-------------|------------------|----------------|-----------------------|

| ORDER_ID | TEXT | TEXT | missing in definition |

| ORDER_KEY | TEXT | | missing in contract |

Which two actions will fix the error? Choose 2 options.

Choose two
Explanation

An enforced dbt model contract requires the model output and contract to have matching column names and data types. The mismatch labels indicate that ORDER_ID is absent from the model definition and ORDER_KEY is absent from the contract. Removing ORDER_ID from the contract and adding ORDER_KEY with the matching data type aligns the contract with the renamed model output. The ORDER_ID row's populated definition_type is inconsistent with its mismatch label. (docs.getdbt.com)

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!