You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a table name is a reserved word and you set the generate_columns parameter to True, the generate_source macro fails with an error. You can avoid this by setting quoting at the project level, but that's not recommended especially for Snowflake according to the docs. It's manageable to flip it on during development and back off.
Run the generate_source macro on the database/schema that includes the group table and generate_columns=True
Expected results
Produce a source schema entry for the table, or fail more elegantly by skipping the table with a placeholder.
Actual results
The code fails with a Runtime Error - see the log output below.
Screenshots and log output
Encountered an error:
Runtime Error
Database Error in analysis _codegen (analysis\_codegen.sql)
001003 (42000): SQL compilation error:
syntax error line 1 at position 40 unexpected 'GROUP'.
syntax error line 1 at position 28 unexpected '.'.
syntax error line 1 at position 39 unexpected '.'.
I haven't fully traced it but I think it's happening in the call to adapter.get_columns_in_relation. The issue does not happen if you don't set generate_columns=True.
Are you interested in contributing the fix?
Possibly. If I do I'll need a nudge on how to solve the issue. Is there a way to override quoting within a macro?
The text was updated successfully, but these errors were encountered:
I saw a similar issue reported on Slack and I think it has nothing to do with this package, nor should be fixed here. My assumption is that it's purely related to the usage of reserved words as identifiers.
This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days.
Although we are closing this issue as stale, it's not gone forever. Issues can be reopened if there is renewed community interest. Just add a comment to notify the maintainers.
Describe the bug
When a table name is a reserved word and you set the
generate_columns
parameter toTrue
, thegenerate_source
macro fails with an error. You can avoid this by setting quoting at the project level, but that's not recommended especially for Snowflake according to the docs. It's manageable to flip it on during development and back off.Seems related to #11.
Steps to reproduce
group
quoting
unspecified inproject.yml
generate_source
macro on the database/schema that includes thegroup
table andgenerate_columns=True
Expected results
Produce a source schema entry for the table, or fail more elegantly by skipping the table with a placeholder.
Actual results
The code fails with a Runtime Error - see the log output below.
Screenshots and log output
System information
The contents of your
packages.yml
file:Which database are you using dbt with?
The output of
dbt --version
:The operating system you're using:
Windows 10
The output of
python --version
:Additional context
I haven't fully traced it but I think it's happening in the call to
adapter.get_columns_in_relation
. The issue does not happen if you don't setgenerate_columns=True
.Are you interested in contributing the fix?
Possibly. If I do I'll need a nudge on how to solve the issue. Is there a way to override quoting within a macro?
The text was updated successfully, but these errors were encountered: