Rurushu13 commented on issue #36688:
URL: https://github.com/apache/airflow/issues/36688#issuecomment-1883340047
> @Rurushu13
> Good finding. If possible, can you share the sample DAG?
@dirrao There it is
`from datetime import timedelta
import pendulum
import os
from airflow.decorators import dag
from airflow.operators.bash import BashOperator
from airflow.hooks.base import BaseHook
@dag(
dag_id="shell_test",
description='testing the shell script',
start_date=pendulum.datetime(2023, 1, 1, tz="Europe/Istanbul"),
schedule='@daily',
catchup=False,
tags=['test'],
default_args={
"retries": 0,
"retry_delay": timedelta(minutes=5),
},
template_searchpath=['include/sql/datawarehouse/source',
'include/sql/datawarehouse/stage',
'include/sql/datawarehouse/final'],)
def shell_test():
airflow_home = os.environ.get('AIRFLOW_HOME')
shell_test_task = BashOperator(
task_id="shell_test_task",
bash_command=f"/bin/bash
{airflow_home}/include/scripts/datawarehouse/transfer_script.sh ",
env={
**{'TARGET_CONNECTION_STRING':
BaseHook.get_connection("DATAWAREHOUSE").get_uri(),
'SOURCE_CONNECTION_STRING':
BaseHook.get_connection("EFABRIKA").get_uri()},
}
)
shell_test()`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]