Rebase #7223: improve contracts error message#7319
Merged
Conversation
|
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Kyle Kent.
|
9cb5b3f to
5d58707
Compare
5d58707 to
be78a7d
Compare
This was referenced Apr 11, 2023
gshank
approved these changes
Apr 11, 2023
MichelleArk
reviewed
Apr 11, 2023
| row = [yaml_col["name"], "", yaml_col["data_type"], "missing in definition"] | ||
| mismatches += [dict(zip(column_names, row))] | ||
|
|
||
| mismatches_sorted = sorted(mismatches, key=lambda d: d["column_name"]) |
MichelleArk
approved these changes
Apr 11, 2023
MichelleArk
reviewed
Apr 11, 2023
core/dbt/exceptions.py
Outdated
| # if name matches | ||
| if sql_col["name"] == yaml_col["name"]: | ||
| # if type matches | ||
| if sql_col["formatted"] == yaml_col["formatted"]: |
Contributor
There was a problem hiding this comment.
for my own understanding - any reason not to do the comparison on data_type at this point?
Contributor
Author
There was a problem hiding this comment.
@MichelleArk Good point! Since we're already comparing columns with the same name, might as well compare just the data_type instead of the formatted value.
This was just how Kyle had it, and it does match the logic here performing the functional comparison.
6 tasks
Contributor
|
Thanks @jtcohen6 ! |
Contributor
|
Nice work @kentkr ! 🏆 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
resolves #7209
rebases #7223
Description
@kentkr did the heavy lifting here! I just added a few small touch-ups:
agatefor structured representation, and to print to stdout in a markdown tableChecklist
I have opened an issue to add/update docs, or docs changes are not required/relevant for this PRchangie newto create a changelog entry