Skip to content

Instantly share code, notes, and snippets.

@cra
Last active August 23, 2022 10:15
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/855b6e59f769f3d93712acd36c45c126 to your computer and use it in GitHub Desktop.
Save cra/855b6e59f769f3d93712acd36c45c126 to your computer and use it in GitHub Desktop.
from airflow.models import DAG
from airflow.utils.dates import days_ago
from airflow.operators.python import PythonOperator
from airflow.operators.empty import EmptyOperator
def ohai(raz, dva, tri, chetyre):
print("Оппа нихуя себе", raz, dva)
print("И так тоже можно:", tri, chetyre)
with DAG(
dag_id="yoba",
schedule_interval=None,
start_date=days_ago(3),
catchup=False,
) as dag:
start = EmptyOperator(task_id='start')
op1 = PythonOperator(
task_id='bzzz',
python_callable=ohai,
op_args=('раз-раз-раз', 'это хардбас'),
op_kwargs={
'tri': 'все в спортивках',
'chetyre': 'адидас',
},
)
end = EmptyOperator(task_id='end')
start >> op1 >> end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment