-
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
Snowflake lowercase environment variable and improper database quoting #1712
Comments
I've confirmed this isn't limited to just snapshots. Happens when using the jinja env_var() in a model schema config. |
From convo on slack, it seems setting the environmental variable within a second set of curly braces should do the following:
But it seems it's being parsed out. |
Hey @tayloramurphy - I wrote up the more generic version of this issue over here: #1717 Please take a look and let me know if you have any questions! A fix for this is prioritized for our next minor release. Thanks so much for the bug report! |
For any future visitors to this issue: the correct syntax is
It is not:
|
Describe the bug
When the config for a snapshot specifies the database as an environment variable via:
target_database=env_var("SNOWFLAKE_LOAD_DATABASE")
Then the database name is not properly quoted.
When the database is set via
target_database='{{ env_var("SNOWFLAKE_LOAD_DATABASE") }}'
Then the environment variable is lower cased and the error returned is
Steps To Reproduce
For improper quoting, start a snowflake database name with a number and reference it in a snapshot. You should see an error like:
In this case our database name is
2206-BRANCHNAME_RAW
.To reproduce the lower case error, just use the jinja interpolation format for the env_var.
Expected behavior
I would expect it to respect the capitalization of the environment variable name and to quote the database name fully.
Screenshots and log output
If applicable, add screenshots or log output to help explain your problem.
System information
Which database are you using dbt with?
The output of
dbt --version
:The operating system you're using:
Mac OSX 10.14
**The output of
python --version
:Python 3.7.4Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: