-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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-2121] Make model contracts agnostic to ordering #6975
Labels
Comments
github-actions
bot
changed the title
Make model contracts agnostic to ordering
[CT-2121] Make model contracts agnostic to ordering
Feb 14, 2023
Note: #7064 cannot be merged before this because the column checks would fail. These two tickets will processed in one pull request. |
6 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
The current model contract comparison (
assert_columns_equivalent
macro) validates that the user-provided column names and data types are identical: in name, type, and order the column names obtained from the model SQL.However, it will be cumbersome for users to ensure that the order of configured columns in a model yaml file always matches with the order the database provides.
For example, the SQL model configured with the schema below fails its contract check:
The equality comparison is done directly on formatted columns from the SQL + schema yaml, and could instead be done on the intermediate collection of unordered columns.
Relevant discussion: #6271 (comment)
Note: should not be merged before #7064, as this ordering check is currently done in
assert_columns_equivalent
and prevents constraint ddl generation from being generated in an invalid order.The text was updated successfully, but these errors were encountered: