Skip to content

[CT-1913] Snapshot target_schema & target_database used from dbt_project.yml #6745

Closed
@minhajpasha

Description

Is this a new bug in dbt-core?

  • I believe this is a new bug in dbt-core
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

Profiles.yml

    dev:
      type: bigquery
      method: oauth
      project: gcp-project-test
      **dataset: holding**
      location: EU

snapshot config in dbt_project.yml

snapshots:
    test_dbt_project
        +persist_docs:
            relation: true
            columns: true
        primary:
            snapshot_models:
                **+target_schema: snapshot_dataset**

schema.yml to add the descriptions to snapshots tables

snapshots:
    - name: customers
      config:
        enabled: true
      columns:
        - name: customer_id
           description: 'customer unique id'

snapshot folder structure:

-snapshots
  -primary
      -snapshot_models
         -customers.sql
         -orders.sql
         - schema.yml

When we add the schema.yml file under snapshots/primary/snapshots_models and run the below command

dbt snapshot --select customers then the model is getting created under holding dataset(profile.yml) instead of snapshot_dataset(dbt_project.yml)

Expected Behavior

The snapshots should be created in the dataset defined in dbt_project.yml file. For now have removed the schema.yml file so that it can create the model's under dataset provided in dbt_project.yml file. This is stopping to add the descriptions to table columns

Steps To Reproduce

details provide in descriptions

Relevant log output

No response

Environment

- OS: Airflow 2.2 composer 2.2
- Python:3.8
- dbt: dbt bigquery 1.2.0

Which database adapter are you using with dbt?

bigquery

Additional Context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

bugSomething isn't workingregressionsnapshotsIssues related to dbt's snapshot functionality

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions