From 430a5392056a7cab72afc8b9eb303ed53b6c0419 Mon Sep 17 00:00:00 2001 From: Amisha Singla Date: Wed, 2 Oct 2024 15:34:49 -0500 Subject: [PATCH] pass args --- dags/dbt_source_data_freshness_test_dag.py | 1 + dags/stellar_etl_airflow/build_dbt_task.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/dags/dbt_source_data_freshness_test_dag.py b/dags/dbt_source_data_freshness_test_dag.py index ac7b4ca2..63b4ec23 100644 --- a/dags/dbt_source_data_freshness_test_dag.py +++ b/dags/dbt_source_data_freshness_test_dag.py @@ -33,6 +33,7 @@ dag, command_type="source", sub_command="freshness", + cmd_args=["source:crypto_stellar.*", "source:crypto_stellar_internal_2.*"], flag=None, tag=None, resource_cfg="dbt", diff --git a/dags/stellar_etl_airflow/build_dbt_task.py b/dags/stellar_etl_airflow/build_dbt_task.py index 0e7055fc..34009bee 100644 --- a/dags/stellar_etl_airflow/build_dbt_task.py +++ b/dags/stellar_etl_airflow/build_dbt_task.py @@ -65,6 +65,7 @@ def dbt_task( tag=None, flag="select", operator="", + cmd_args=[], command_type="build", excluded=None, resource_cfg="default", @@ -95,6 +96,9 @@ def dbt_task( if flag: args.append(f"--{flag}") + if len(cmd_args): + args = [*args, *cmd_args] + models = [] if tag: task_name = tag