-
Notifications
You must be signed in to change notification settings - Fork 40
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
[Bug] --empty
flag generates invalid SQL when running adapter.get_columns_in_relation
#213
Comments
May be related to dbt-labs/dbt-core#10139 |
@jlucas91 Thanks for opening - I think it's actually the same as: This isn't Snowflake-specific, it would be relevant anywhere we're:
I don't think that happens everywhere:
So while on first read I was worried this was going to be an issue everywhere — I think we just need to do the work of combing through those call sites in our adapters. A reasonable lift, but it feels doable. In the meantime we can document this as a limitation. |
Scope of this fix should also include adding tests to cover some of these edge cases, resolving dbt-labs/dbt-snowflake#1033 and updating maintainer docs |
Opened a new issue in dbt-labs/docs.getdbt.com: dbt-labs/docs.getdbt.com#5734 |
adapter.get_columns_in_relation
--empty
flag generates invalid SQL when running adapter.get_columns_in_relation
Is this a new bug?
Current Behavior
When running the
--empty
flag introduced in DBT 1.8adapter.get_columns_in_relation
generates and runs an invalid DESCRIBE TABLE statement, halting the run. The statement looks roughly like:describe table (select * from TABLE_NAME_HERE where false limit 0)
Which generates the error:
Expected Behavior
adapter.get_columns_in_relation
should fallback to some reasonable default when running with the --empty flag, or alternatively throws a more intelligible error message.For our usages, I'm working around it by guarding calls to
adapter.get_columns_in_relation
behind a check on whether we're running in empty mode. However, this is cumbersome and a bit error prone.Steps To Reproduce
./dbt run --empty
on a model that usesadapter.get_columns_in_relation
Relevant log output
No response
Environment
Additional Context
No response
The text was updated successfully, but these errors were encountered: