Skip to content

Instantly share code, notes, and snippets.

@cra
Created November 20, 2023 10:56
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/06f6d8c50844c6dd621e072fd625327d to your computer and use it in GitHub Desktop.
Save cra/06f6d8c50844c6dd621e072fd625327d to your computer and use it in GitHub Desktop.
from airflow import DAG # noqa
from airflow.decorators import task
from airflow.operators.empty import EmptyOperator
from airflow.operators.python import PythonOperator
from airflow.decorators import dag
import pendulum
@dag(
schedule='@hourly',
start_date=pendulum.parse('2023-11-20 10:00'),
catchup=False,
)
def dudkov_dag():
def _func(fancy_time, **kwargs):
print(fancy_time)
op = PythonOperator(
task_id='print_fancy_time',
op_args=['YOBA: {{ dag_run.logical_date.strftime("%Y-%m-%dPROBEL%H:%M:00") }}'],
python_callable=_func,
)
start = EmptyOperator(task_id='start')
start >> op
_ = dudkov_dag()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment