Skip to content

[BUG] Quotes in fully-qualified database name for sources #1007

@dbeatty10

Description

@dbeatty10

Describe the bug
Quotes in fully-qualified database name for sources.

What version of dbt Fusion is this bug in? (find out by running dbt --version)

Is this a discrepancy between the dbt Fusion Engine and dbt Core? Check one.

  • YES
  • NO

To Reproduce

  1. Open this workspace
  2. Follow the instructions in the README

Create these files:

dbt_project.yml

name: 'my_project'
profile: 'snowflake'

quoting:
  database: true
  identifier: true
  schema: true

models/_sources.yml

sources:
  - name: my_source
    database: my_database
    schema: my_schema
    tables: 
     - name: my_table

models/my_model.sql

{{
    config(
        materialized='incremental',
        incremental_strategy='insert_overwrite',
    )
}}

select * 
from {{ source("my_source", "my_table") }}

Using a Snowflake target, compare the compiled SQL in the target directory after each of these commands:

fs compile -s my_model
dbt compile -s my_model

One uses quotes for each part of the fully qualified database name for the source and the other does not.

Expected behavior
I expected Core and Fusion to have the same compiled output.

Namely, for sources to use the quoting config for sources which is different than the quoting config for ref'd resources

Screenshots
If applicable, add screenshots to help explain your problem.

Operating System and CPU Type (please complete the following information):

  • Mac/Windows/Linux?
  • X86 or ARM?

Metadata

Metadata

Assignees

Labels

ConformancebugSomething isn't workingdiscrepancydiscrepancy between the dbt Fusion Engine and dbt Corehas-reproHas a reproducible example

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions