Skip to content

Unable to override database name #33

@niclas-roos

Description

@niclas-roos

Describe the bug

I'm trying to use generate_source in dbt cloud, running it in the prompt, to generate_source for my raw database in Snowflake, but it seems to be overridden by the default target database, analytics.

Steps to reproduce

I'm running the following script in the prompt:
dbt run-operation generate_source --args '{schema_name: BINGADS, database_name: raw}'

I've installed packages using dbt deps

Expected results

version: 2

sources:
  - name: bingads
    database: raw
    tables:
      - name: account_history
      - name: account_impression_performance_daily_report
      - name: etc

Actual results

version: 2

sources:
  - name: bingads
    database: raw
    tables:

Screenshots and log output

Log output:
On macro_generate_source: /* {"app": "dbt", "dbt_version": "0.18.0", "profile_name": "user", "target_name": "default", "connection_name": "macro_generate_source"} */

Part of log output showing the compiled SQL:

select distinct
    table_schema as "table_schema", table_name as "table_name"
from ANALYTICS.information_schema.tables
where table_schema ilike 'BINGADS'
and table_name ilike '%'
and table_name not ilike ''

System information

The contents of your packages.yml file:

packages:
  - package: fishtown-analytics/dbt_utils
    version: 0.6.1
  - package: fishtown-analytics/codegen
    version: 0.3.0

Which database are you using dbt with?

  • postgres
  • redshift
  • bigquery
  • snowflake
  • other (specify: ____________)

The output of dbt --version:

"dbt_version": "0.18.0"

The operating system you're using:

The output of python --version:

Additional context

Are you interested in contributing the fix?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions