Use datasets from different locations and different projects in DBT

Viewed 822

I do know you can configure your default desired location in the profiles.yaml

default:
  target: default
  outputs:
    default:
      type: bigquery
      method: oauth
      dataset: default_dataset
      location: europe-west1

But then all the rest of the defined sources (Bigquery Datasets in my case) will have this same location. So I could not query a dataset located in europe-east2 anymore in this project

version: 2
sources:
  - name: dataset_in_asia_location
    tables:
      - name: incremental_table

There's nothing in the documentation for the sources (props nor configs)

So, how do you use a dbt source from a diferent location that the default one defined in the profiles.yaml?

1 Answers

The documentation of DBT states that DBT will use the default location unless you specify a custom project/database config.

my-profile:
 target: dev
 outputs:
   dev:
     type: bigquery
     method: oauth
     project: abc-123
     dataset: my_dataset

Additionally, in the .yaml location, it is recommended to use multi-region locations.

Related