0
votes

When doing "DBT run" I get the following error

{{ config(materialized='table') }}

SELECT customer_id FROM `hello-data-pipeline.adwords.google_ads_campaign_stats` 

I am making sure that my FROM location contains 3 parts

  • A project (hello-data-pipeline)
  • A database (adwords)
  • A table (google_ads_campaign_stats)

But I get the following error

15:41:51 | 2 of 3 START table model staging_benjamin.yo......................... [RUN]
15:41:51 | 2 of 3 ERROR creating table model staging_benjamin.yo................ [ERROR in 
0.32s]
Runtime Error in model yo (models/yo.sql)
404 Not found: Dataset hello-data-pipeline:staging_benjamin was not found in location EU

NB. Bigquery does not show any error when doing this query in Bigquery Editor. NB 2 DBT does not show any error when "running sql" command directly in the script editor

What I am doing wrong ?

2

2 Answers

1
votes

You may need to specify a location where your query will run. Queries that run in a specific location may only reference data in that location. You may choose auto-select to run the query in the location where the data resides.

Read more about Dataset locations

0
votes

OK I found. I needed to specify the location in the profile.yml file. => https://docs.getdbt.com/reference/warehouse-profiles/bigquery-profile/#dataset-locations

In DBT cloud you will find it when setting up your project