Replies: 2 comments 6 replies
-
Hey @jeremyyeo! Thanks for this. :-) My initial reaction is "why are the two topics combined into one post?" I have to admit, I share my Discourse post you linked to customers and prospects at least once a week. I would love to have this resource available on the docs site rather than Discourse, but I don't typically talk about the So my ask is... could this be broken out into two separate posts? One that replaces my Discourse post, and the other about |
Beta Was this translation helpful? Give feedback.
-
The Airflow + dbt Cloud guide is now live if you want to try adding/expanding on it with some of this! |
Beta Was this translation helpful? Give feedback.
-
The following playbook covers:
generate_database_name
macro.It is expected that you already know:
We will be making use of @boxysean's Python code in this discourse post.
The
generate_database_name
macro is responsible for determining the database that dbt uses when it runs. You can incorporate much more complex logic (see above linked documentation to it) to it but what we're doing here is we're instructing dbt to look for a variable calleddb_override
(that we can set at runtime) and use that as the name of the database. Note that if the variable is not set during the run, the value of'development'
will be assigned to that variable by default (and that is what will determine the database name).ACCOUNT_ID
andJOB_ID
accordingly:Click to expand...
DBT_CLOUD_API_TOKEN
env var with your dbt Cloud API Key:Check that the run successfully created our model in the
development
database (default behaviour since we didn't pass in thedb_override
var at run time:json
payload in the script above:Check that the run successfully created our model in the
analytics
database:Beta Was this translation helpful? Give feedback.
All reactions