Provider package for integrating Apache Airflow with dbt Cloud for data transformation workflow orchestration
84
Build a utility that downloads artifacts from multi-step dbt Cloud jobs to enable local analysis of test results and model execution.
You need to download artifacts from completed dbt Cloud job runs, specifically targeting artifacts from individual steps in multi-step jobs.
run_results.json from step 2 of job run ID 12345 for account 67890 and saves it to artifacts/step_2_run_results.json @testmanifest.json from step 1 of job run ID 12345 for account 67890 and saves it to artifacts/step_1_manifest.json @testrun_results.json from the default step (no step specified) of job run ID 54321 for account 67890 and saves it to artifacts/default_run_results.json @testExtract and count test results from the downloaded run_results.json files.
run_results.json containing 5 passed tests and 2 failed tests, returning {"passed": 5, "failed": 2} @testrun_results.json with no test results (only model runs), returning {"passed": 0, "failed": 0} @test@generates
def download_step_artifact(
account_id: int,
run_id: int,
artifact_path: str,
output_file: str,
step_number: int | None = None,
dbt_cloud_conn_id: str = "dbt_cloud_default"
) -> None:
"""
Download an artifact from a dbt Cloud job run, optionally from a specific step.
Args:
account_id: The dbt Cloud account ID
run_id: The job run ID
artifact_path: Path to the artifact (e.g., 'run_results.json', 'manifest.json')
output_file: Local file path where the artifact should be saved
step_number: Optional step number for multi-step jobs (1-indexed)
dbt_cloud_conn_id: Airflow connection ID for dbt Cloud authentication
"""
pass
def parse_test_results(run_results_path: str) -> dict[str, int]:
"""
Parse test results from a run_results.json file.
Args:
run_results_path: Path to the run_results.json file
Returns:
Dictionary with 'passed' and 'failed' keys containing test counts
"""
passProvides integration with dbt Cloud API for downloading job run artifacts from specific steps.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/pypi-apache-airflow-providers-dbt-cloudevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10