lawwu
August 24, 2022, 3:53pm
1
Hello,
First time adopter of dbt in the last couple months. I had a question around best practices in handling dbt runs for dev and prod. I’d like to:
Have a daily job that runs dbt run
to target a dev schema
Run dbt test
to make sure all the unit tests pass
Run dbt run --target prod
A couple of questions:
Is this order of operations typical?
We’re using big query. Is it possible to have the the dev target in one GCP “dev” project and the prod target in a GCP “prod” project?
pcreux
August 26, 2022, 10:00am
2
Hello there,
You can definitely target two different GCP projects.
Ex:
# profiles.yml
templates:
bigquery: &bigquery
# run the following command to authenticate:
# $> gcloud auth application-default login --scopes=https://www.googleapis.com/auth/bigquery
dbname: analytics
type: bigquery
method: oauth
threads: 10
timeout_seconds: 300
priority: interactive
retries: 1
default:
outputs:
dev:
<<: *bigquery
project: acme-dev
prod:
<<: *bigquery
project: acme-prod
target: dev
2 Likes
pcreux:
<<: *bigquery
@pcreux I haven’t seen this <<:
syntax before - does this let you take all of the contents of an anchor and then append extra keys? That’s very exciting because it has always annoyed me that I couldn’t make that work!
pcreux
September 27, 2022, 9:18am
4
@joellabes Yes! You’re totally right!
obar1
October 16, 2022, 8:34am
5
1 Like