-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Write better error message for schema test list indices #1325
Comments
thanks for the report @tjengel - prioritized for our Wilt Chamberlain release (should be 0.14.0) |
As of
The message comes from here. I find that error reasonably informative. I'm open to changing it if we want to detect the exact case where a user passed a list there, though we should maybe also handle some other cases there (like null). |
@beckjake hmm, this message is definitely a lot better than a stack trace! What would the error message look like if |
|
Ok, I think that's great! Let's just format this a little better then. Instead of
Let's aim for:
I don't know if we are able to capture a line number here... if not, just leave that part out. This format is more in line with other compiler warning test output, like if you supply a |
There's no easy way to capture line numbers from parsed yaml as far as I know, so I'll just leave that out. |
…a-test-errors Improve invalid test warnings/errors (#1325)
Issue
Typing
- column_name
instead ofcolumn_name
in the tests section of a schema file results in this error messageTypeError: list indices must be integers or slices, not dict
. This error message should be more useful. @drewbanin suggestsIssue description
I ran into this issue after typing
- column_name
instead ofcolumn_name
in the tests section of a scheme.yml file.Results
I got this error
System information
The output of
dbt --version
:The operating system you're running on:
The python version you're using (probably the output of
python --version
)Steps to reproduce
I had code like
When running dbt test or dbt compile, this failed with the above error. Removing the
-
in front of column_name fixed it.The text was updated successfully, but these errors were encountered: