Integrations
DBT Cloud in Mage
Integrations
DBT Cloud in Mage
Trigger model runs in DBT Cloud.
Configuration
Here are the following keyword arguments that can be used for configuration:
Keyword argument | Description | Sample value |
---|---|---|
account_id | DBT Cloud account ID | 12345 |
api_token | Service account tokens | abc123 |
Example code
Trigger job run with job_id
.
from mage_ai.services.dbt.dbt import DbtCloudClient
client = DbtCloudClient(dict(account_id=12345, api_token='abcdefg'))
# Set poll_status=True to wait for job completion.
# Set poll_status=False to not wait for job completion.
client.trigger_job_run(12345, poll_status=True)
Sample output:
Polling DBT Cloud run 12345. Current status: Starting.
Polling DBT Cloud run 12345. Current status: Running.
Polling DBT Cloud run 12345. Current status: Success.
Job run status for run 12345: Success. Polling complete
Methods
Common APIs in DBT Cloud implemented in the
DbtCloudClient
.
get_run
list_jobs
list_runs
trigger_job_run