Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CT-2287] Clarify contract error message #7147

Closed
emmyoop opened this issue Mar 9, 2023 · 1 comment
Closed

[CT-2287] Clarify contract error message #7147

emmyoop opened this issue Mar 9, 2023 · 1 comment

Comments

@emmyoop
Copy link
Member

emmyoop commented Mar 9, 2023

Right now the error message for errors related to having contracts enabled does not mention that the error is being hit because contracts are enabled for the model. Add some verbiage to the effect that the model is contracted so all the following have more context.

{%- do exceptions.raise_compiler_error('Please ensure the name, data_type, order, and number of columns in your `yml` file match the columns in your SQL file.\nSchema File Columns: ' ~ (schema_file_provided_columns_formatted|trim) ~ '\n\nSQL File Columns: ' ~ (sql_file_provided_columns_formatted|trim) ~ ' ' ) %}

16:00:13  Compilation Error in model my_model (models/contracted_models/my_model.sql)
16:00:13    Please ensure the name, data_type, order, and number of columns in your `yml` file match the columns in your SQL file.
16:00:13    Schema File Columns:
16:00:13
16:00:13    SQL File Columns: id INT, color TEXT, date_day DATE
16:00:13
16:00:13    > in macro assert_columns_equivalent (macros/materializations/models/table/columns_spec_ddl.sql)
16:00:13    > called by macro default__get_assert_columns_equivalent (macros/materializations/models/table/columns_spec_ddl.sql)
16:00:13    > called by macro get_assert_columns_equivalent (macros/materializations/models/table/columns_spec_ddl.sql)
16:00:13    > called by macro default__create_view_as (macros/materializations/models/view/create_view_as.sql)
16:00:13    > called by macro create_view_as (macros/materializations/models/view/create_view_as.sql)
16:00:13    > called by macro default__get_create_view_as_sql (macros/materializations/models/view/create_view_as.sql)
16:00:13    > called by macro get_create_view_as_sql (macros/materializations/models/view/create_view_as.sql)
16:00:13    > called by macro statement (macros/etc/statement.sql)
16:00:13    > called by macro materialization_view_default (macros/materializations/models/view/view.sql)
16:00:13    > called by model my_model (models/contracted_models/my_model.sql)
16:00:13
16:00:13  Done. PASS=0 WARN=0 ERROR=2 SKIP=1 TOTAL=3
@github-actions github-actions bot changed the title Clarify contract error message [CT-2287] Clarify contract error message Mar 9, 2023
@dbeatty10 dbeatty10 removed the triage label Mar 9, 2023
@jtcohen6
Copy link
Contributor

Resolved by #7161

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants