-
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-981] Raise clear warning/error if yaml property key is misnamed #5605
Comments
@albertovpd Thanks for opening! I tried this out locally, and I found that I think the deal here is that our dataclasses / validation for both models:
- name: some_model
invalid_key:
- something
columns:
- name: id
invalid_key:
- something_else It would be better if dbt raised a clear and explicit error message that |
You're right @jtcohen6 |
I just closed an older issue that's really the same as this one: #4280 That one had several comments/upvotes. This is definitely a UX improvement that several people have asked for explicitly, and it would likely benefit many many more! |
From @alittlesliceoftom here:
|
Another example from "the wild" (ie Community Slack thread) user reported that the datawarehouse was not changed as defined in their config {{
config(
materialized='table',
schema='finance',
snowflake_datawarehouse='DATAWAREHOUSE_MEDIUM'
)
}} the issue is they were using |
Here is a further example of someone creating an invalid model config (they confused it with a source config) and it would have been helpful for this to throw a parsing error because their yaml is incorrectly formatted, rather than failing in a more obscure way. https://getdbt.slack.com/archives/CBSQTAPLG/p1702483400951449 |
Thanks for linking that thread in Slack to this feature request @mwstanleyft ! This is a nice summary of the surprise factor:
|
Acceptance criteria
For refinement
We may not want to raise errors at this time since that would increase the risk of introducing breaking changes to projects that are currently working (even if they have been misconfigured in an invisible way). Raising a warning is a more gentle on-ramp than jumping all the way to raising an error. The trade-off is that warnings are less visible than errors and may be overlooked. If we choose to go the "warnings only" route, we can still reserve the right to elevate this all the way to an error at some point in the future. |
Is this a new bug in dbt-core?
Current Behavior
I am testing a model which have 2 tests for a column.
If tests are called under a field named test and not testS, it runs satisfactorily just the 1st of the tests, without warning/logging errors about that the 2nd test did not run.
Expected Behavior
To have an error output like the following:
Found more than 1 test under the test field. Please reference the structure as "tests"
Steps To Reproduce
Relevant log output
The problem is that there is no output warning about just the first test ran
Environment
Which database adapter are you using with dbt?
bigquery
Additional Context
I created this custom test and regardless the name of the column, it always passed. Then I realised that the test section in the yml file should be named tests, in plural. Then, it works.
The text was updated successfully, but these errors were encountered: