Skip to content

Commit

Permalink
send args
Browse files Browse the repository at this point in the history
  • Loading branch information
amishas157 committed Oct 4, 2024
1 parent 8260234 commit 4de573f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion dags/elementary_report_dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 4de573f

Please sign in to comment.