airflow-provider-paradime-dbt
This is the provider for Paradime to run and manage dbt™ jobs in production. The provider enables interaction with Paradime’s Bolt scheduler and management APIs.
Usage
Create a connection
- Generate your API key, secret and endpoint from Paradime Workspace settings.
- Create a connection in Airflow, as shown below.
Create a DAG
Here is one example:
from airflow.decorators import dag
from paradime_dbt_provider.operators.paradime import ParadimeBoltDbtScheduleRunArtifactOperator, ParadimeBoltDbtScheduleRunOperator
from paradime_dbt_provider.sensors.paradime import ParadimeBoltDbtScheduleRunSensor
PARADIME_CONN_ID = "your_paradime_conn_id"
BOLT_SCHEDULE_NAME = "your_schedule_name"
@dag(
default_args={"conn_id": PARADIME_CONN_ID},
)
def run_schedule_and_download_manifest():
task_run_schedule = ParadimeBoltDbtScheduleRunOperator(task_id="run_schedule", schedule_name=BOLT_SCHEDULE_NAME)
run_id = "{{ task_instance.xcom_pull(task_ids='run_schedule') }}"
task_wait_for_schedule = ParadimeBoltDbtScheduleRunSensor(task_id="wait_for_schedule", run_id=run_id)
task_download_manifest = ParadimeBoltDbtScheduleRunArtifactOperator(task_id="download_manifest", run_id=run_id, artifact_path="target/manifest.json")
output_path = "{{ task_instance.xcom_pull(task_ids='download_manifest') }}"
task_run_schedule >> task_wait_for_schedule >> task_download_manifest
run_schedule_and_download_manifest()
Refer to the example DAGs in this repository for more examples.