From 28aa4ef0e809f6ede4e73f0be231d9e11bea8e80 Mon Sep 17 00:00:00 2001 From: ori Date: Wed, 30 Oct 2024 07:57:55 +0200 Subject: [PATCH] add sql application name --- open_bus_pipelines/operators/cli_bash_operator.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/open_bus_pipelines/operators/cli_bash_operator.py b/open_bus_pipelines/operators/cli_bash_operator.py index ffd1b0a..b779d22 100644 --- a/open_bus_pipelines/operators/cli_bash_operator.py +++ b/open_bus_pipelines/operators/cli_bash_operator.py @@ -20,7 +20,8 @@ class CliBashOperator(BashOperator): def __init__(self, cmd, **kwargs): assert not kwargs.get('bash_command') - kwargs['bash_command'] = '{print_dag_run}{pip_install_deps}{STRIDE_VENV}/bin/{cmd}'.format( + kwargs['bash_command'] = '{print_dag_run}{pip_install_deps}{ENV}{STRIDE_VENV}/bin/{cmd}'.format( + ENV=f'SQLALCHEMY_APPLICATION_NAME="{self.task_id}" SQLALCHEMY_APPLICATION_VERSION="$(cat {STRIDE_VENV}/open_bus_pipelines_commit.txt)" ', STRIDE_VENV=STRIDE_VENV, cmd=cmd, print_dag_run=get_print_dag_run(),