From 4de573fec378fe935b26173f4a77034bbf0a7588 Mon Sep 17 00:00:00 2001 From: Amisha Singla Date: Thu, 3 Oct 2024 22:03:49 -0500 Subject: [PATCH] send args --- dags/elementary_report_dag.py | 3 ++- .../build_elementary_slack_alert_task.py | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dags/elementary_report_dag.py b/dags/elementary_report_dag.py index a8900730..cc5c7ae9 100644 --- a/dags/elementary_report_dag.py +++ b/dags/elementary_report_dag.py @@ -31,7 +31,8 @@ dag, "generate_report", resource_cfg="dbt", - command="send-report --select last_invocation", + command="send-report", + cmd_args=["--select", "last_invocation"], ) elementary_alerts diff --git a/dags/stellar_etl_airflow/build_elementary_slack_alert_task.py b/dags/stellar_etl_airflow/build_elementary_slack_alert_task.py index 3853cfc2..738b5810 100644 --- a/dags/stellar_etl_airflow/build_elementary_slack_alert_task.py +++ b/dags/stellar_etl_airflow/build_elementary_slack_alert_task.py @@ -19,7 +19,9 @@ def access_secret(secret_name, namespace): return secret -def elementary_task(dag, task_name, resource_cfg="default", command="monitor"): +def elementary_task( + dag, task_name, cmd_args=[], resource_cfg="default", command="monitor" +): namespace = conf.get("kubernetes", "NAMESPACE") if namespace == "default": @@ -48,6 +50,9 @@ def elementary_task(dag, task_name, resource_cfg="default", command="monitor"): "{{ var.value.dbt_slack_elementary_channel }}", ] + if len(cmd_args): + args.append(cmd_args) + logging.info(f"sh commands to run in pod: {args}") return KubernetesPodOperator(