Created
November 20, 2023 10:56
-
-
Save cra/06f6d8c50844c6dd621e072fd625327d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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