You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the existing issues, and I could not find an existing issue for this feature
I am requesting a straightforward extension of existing dbt functionality, rather than a Big Idea better suited to a discussion
Describe the feature
When a model contract fails, there's a lot of guff that gets in the way of seeing the actual issue, and comes dangerously close to spilling out of most consoles (Cloud IDE shown here, but I run my VS Code console smaller than this):
Compilation Error in model my_first_dbt_model (models/example/my_first_dbt_model.sql)
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 |
| -------------------------- | --------------- | ------------- | --------------------- |
| ID | TEXT | FIXED | data type mismatch |
| THIS_COLUMN_DOESNT_EXIST | | TEXT | missing in definition |
| THIS_COLUMN_SHOULDNT_EXIST | TIMESTAMP_LTZ | | missing in contract |
> in macro assert_columns_equivalent (macros/materializations/models/table/columns_spec_ddl.sql)
> called by macro default__get_assert_columns_equivalent (macros/materializations/models/table/columns_spec_ddl.sql)
> called by macro get_assert_columns_equivalent (macros/materializations/models/table/columns_spec_ddl.sql)
> called by macro snowflake__create_view_as_with_temp_flag (macros/adapters.sql)
> called by macro snowflake__create_view_as (macros/adapters.sql)
> called by macro create_view_as (macros/materializations/models/view/create_view_as.sql)
> called by macro default__get_create_view_as_sql (macros/materializations/models/view/create_view_as.sql)
> called by macro get_create_view_as_sql (macros/materializations/models/view/create_view_as.sql)
> called by macro statement (macros/etc/statement.sql)
> called by macro create_or_replace_view (macros/materializations/models/view/create_or_replace_view.sql)
> called by macro materialization_view_snowflake (macros/materializations/view.sql)
> called by model my_first_dbt_model (models/example/my_first_dbt_model.sql)
1 of 2 ERROR creating sql view model dbt_jlabes.my_first_dbt_model ............. [ERROR in 0.88s]
Finished running node model.my_new_project.my_first_dbt_model
It would be better if instead it was like this:
Compilation Error in model my_first_dbt_model (models/example/my_first_dbt_model.sql)
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 |
| -------------------------- | --------------- | ------------- | --------------------- |
| ID | TEXT | FIXED | data type mismatch |
| THIS_COLUMN_DOESNT_EXIST | | TEXT | missing in definition |
| THIS_COLUMN_SHOULDNT_EXIST | TIMESTAMP_LTZ | | missing in contract |
1 of 2 ERROR creating sql view model dbt_jlabes.my_first_dbt_model ............. [ERROR in 0.88s]
Finished running node model.my_new_project.my_first_dbt_model
Describe alternatives you've considered
No response
Who will this benefit?
People who like concise and usable error messages. I guess this is happening since it's a compiler error, and normally the macros that got us to a compilation error are highly relevant. But in this case they're 100% internal macros so it's not useful.
Are you interested in contributing this feature?
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered:
github-actionsbot
changed the title
[Feature] Suppress stack trace when a model contract is violated
[CT-2897] [Feature] Suppress stack trace when a model contract is violated
Aug 1, 2023
@joellabes I agree this would be nicer without the full stacktrace!
I also share your instinct that this is because it's a CompilationError, and so we're appending the macro traceback. We should look into seeing if we can have different behavior for ContractError in particular.
This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days.
Is this your first time submitting a feature request?
Describe the feature
When a model contract fails, there's a lot of guff that gets in the way of seeing the actual issue, and comes dangerously close to spilling out of most consoles (Cloud IDE shown here, but I run my VS Code console smaller than this):
It would be better if instead it was like this:
Describe alternatives you've considered
No response
Who will this benefit?
People who like concise and usable error messages. I guess this is happening since it's a compiler error, and normally the macros that got us to a compilation error are highly relevant. But in this case they're 100% internal macros so it's not useful.
Are you interested in contributing this feature?
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: