-
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
[CT-53] [Bug] Possible regression - dbt 1.0 doesn't work properly if alias has quotes in them #4581
Comments
Seems relevant: #3835 (comment) |
Hi @jeremyyeo , thanks for submitting the issue and steps to reproduce! And sorry for the delayed response! I talked with @jtcohen6 this morning about this. With the information we currently gathered, we think we are not going to fix this, but rather prefer users set all quoting config to The quoting for the project can't be set for an individual model. However, the quote for sources is more configurable. Since we do understand sometimes the naming convention for those tables is out of the analyst's hand. Let me know if you believe we definitely need to keep supporting the exact behavior in 0.21 for this case and we can reopen the issue. |
Hey @ChenyuLInx, keen to kick this back open again. There are some customers who have legacy reason that their tables have special characters, and thus they have been doing something like this on Snowflake all this while (pre-1.0) without errors: -- my_table_model.sql
{{ config(alias='"FOO_/BAR123"') }}
select 1 as user_id Now as soon as they upgrade to dbt 1.0, they are hit with the We can try removing the quotes from the -- my_table_model.sql
{{ config(alias='FOO_/BAR123') }}
select 1 as user_id # dbt_project.yml
quoting:
identifier: true Looks like this works: Now what happens if they had previously been using a package like our Let's give it a shot: # packages.yml
packages:
- package: dbt-labs/logging
version: 0.6.0
We run into our good friend This means that now they have to do some tweaking (maybe drop the previous logging table or rename it in Snowflake, or change some of the code in the logging package, etc). Now, I only tested this toy example (+ 1 package) but I imagine that if we get into incremental materializations and what not it is only going to become more tedious to upgrade. So for users who cannot escape using special characters in their table names1, I propose we revert the behaviour or it is going to be difficult to figure out a happy path of migration from a pre-1.0 to a post-1.0 world for these users. Footnotes
|
@jeremyyeo I'm very sympathetic to users who need to handle special characters in I appreciate the complexity of the v1.0 migration, given that we're asking folks to upgrade pretty soon. I could see supporting an optional config (flag / env var) that optionally undoes the change made in #4076, only as a temporary salve while folks work on switching to snake-case model identifiers. Something like:
|
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 remove the stale label or comment on the issue, or 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; add a comment to notify the maintainers. |
Is there an existing issue for this?
Current Behavior
With dbt
1.0
, a model that has quotes in it'salias
config ('"my_Model_1"'
) will run into an approximate match error on the next run of the model. dbt0.21
will happily recreate that model on each run.Note that project level quoting is unspecified in the
dbt_project.yml
for either case and this happens with both core and cloud.Expected Behavior
dbt 1.0 should follow 0.21 behaviour and recreate the model on each run - maybe? Unless we're saying 1.0 is the well behaved pattern. Fyi, the use-case here is that some users have model/alias/table names that they want to only quote some of the time and not all of the time (such as setting the
quoting
config on the project level) and they have been using this pattern pre-1.0.Steps To Reproduce
Create a simple model:
And a simple dbt_project.yml file:
Then run twice:
Relevant log output
Environment
What database are you using dbt with?
snowflake
Additional Context
dbt 1.0.1
dbt 0.21.0
The text was updated successfully, but these errors were encountered: