Skip to content

Instantly share code, notes, and snippets.

@cra
Created March 1, 2023 21:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cra/33fb6f612c4abf29e2a8cf19ecb995cd to your computer and use it in GitHub Desktop.
Save cra/33fb6f612c4abf29e2a8cf19ecb995cd to your computer and use it in GitHub Desktop.
import os
import pendulum
from airflow import DAG
from airflow.decorators import dag
from airflow.operators.empty import EmptyOperator
from airflow.operators.bash import BashOperator
base_path = os.path.dirname(os.path.abspath(__file__))
file_path = os.path.join(base_path, 'YM_logs')
@dag(
schedule_interval=None,
start_date=pendulum.datetime(2023, 3, 1),
catchup=False
)
def dobroy_nochi_boris():
start = EmptyOperator(task_id='start')
task1 = BashOperator(
task_id='preved',
bash_command=f'''
echo ${{AIRFLOW_HOME}} --path {file_path}'''
)
start >> task1
_ = dobroy_nochi_boris()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment