-
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
dbt docs generate fails when a column name is " " #2564
Comments
Is there any update on this issue? |
No update Fortunately there's a good workaround — you can rename the column (do you really want a column named |
Aah okay i don't have a column named ' ' but I give null to a column as I need it for validations at later point. eg: null as 'abc' .. this is resulting in same error |
I feel that any column named |
Yeah true that, we just want to use it so that the union doesn't break. Hence populating that column with null values. The column name given in the syntax is not NULL. but in the statement we are using it as NULL as 'abc' (select null as 'abc') - this is also resulting in this error. |
Just to clarify, you're defining a model like:
I'm surprised to hear that you're seeing this error, since |
@jtcohen6 Yes, i use ephimeral models the column names are not null or ' '. They are all unique, but still I get the same error as I am populating it with null |
You're getting this error?
Would you mind providing a few more details so that I could replicate it? |
Hi @jtcohen6 , I tried to replicate it in my colleague's system. It worked well, seems there is an issue with my system. I tried uninstalling dbt, it's dependency packages then installing it from scratch. I also uninstalled python and checked but still it fails. Do you recommend any options other than what I tried? PFB the error and error log: Log File: I initialized a new dbt project and ran dbt docs generate on top of it, which still resulted in the above errors. |
As the original bug report states, this can also happen when an existing table in your data warehouse has a poorly-named column! (The above instructions were to replicate the bug in the easiest way possible) I'd suggest using the information schema to find any columns with a name that would get coerced to a If you're using snowflake, this might look like:
Make sure you check it for all Snowflake databases that you use. |
Thanks Claire, You are a Savior! There was some irrelevant columns with null already existing which was leading to this error. @clrcrl I spent literally hours but still had no clue, thanks once again for you time and inputs :) |
Ha, yes the first time we saw this bug it took a while to figure out what was going on!!! |
Resolved by #3499 (tested with the |
Describe the bug
A clear and concise description of what the bug is. What command did you run? What happened?
Steps to reproduce
" "
(I know)dbt docs generate
(Note this also applies to source tables with this column name, but easiest to reproduce by creating a model)
Expected behavior
An error, but with a good message
Actual behaviour
Screenshots and log output
System information
Which database are you using dbt with?
The output of
dbt --version
:Additional context
'null'
.Workaround
Rename the column!
This often crops up if an existing relation (rather than a dbt-generated relation) has a strange column name. To find the column, use the information schema. For example, on Snowflake this would look like:
Make sure you check all databases that your dbt project references!
The text was updated successfully, but these errors were encountered: