From 9ae2d23f16723b2c6045caa261a9d3ec0b5fdf37 Mon Sep 17 00:00:00 2001 From: Cyril Motte Date: Tue, 11 Jun 2024 08:48:01 +0200 Subject: [PATCH] add my first dag --- .github/dependabot.yml | 12 ++++ .../dags/__pycache__/my_dag.cpython-312.pyc | Bin 0 -> 1580 bytes airflow/dags/my_dag.py | 56 ++++++++++++++++++ airflow/logs/scheduler/latest | 2 +- 4 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 .github/dependabot.yml create mode 100644 airflow/dags/__pycache__/my_dag.cpython-312.pyc create mode 100644 airflow/dags/my_dag.py diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..f33a02c --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,12 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for more information: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates +# https://containers.dev/guide/dependabot + +version: 2 +updates: + - package-ecosystem: "devcontainers" + directory: "/" + schedule: + interval: weekly diff --git a/airflow/dags/__pycache__/my_dag.cpython-312.pyc b/airflow/dags/__pycache__/my_dag.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7f564861ffbb721a41a27cf8bf4711d1faa62446 GIT binary patch literal 1580 zcma)6O>7%Q6n?X7@2)rgi4)g$5<3bh5V)~_of}s!Zn>;hLRe~ZarXnp7SRRXXL6ezL5AyqXvXlBH@g8@(F? zU}-j1lZ1!o$ctx?O`wy%3^%|f>k@(6xGsB*g_}*Qejdf}c*S(i0C_G+7vkjZ@ z`PtQeSPcdIiR?-{{k5-%*QXs|lMGR5Q=;@3h5&4G`^#5Sy!W3<<7JCGf712>esMxgg1 ztOj#~#0qmgqYrdkQTWWv%;{9Q)%MC}gWs`R>t$-z+_KX#@OQr53C0Yo-fFqb2y?^2 zc^(r*DeiSN_rSlD+g|=|`3NG{^!v-l5Xp{g=_fi&6dru=LuxDG$0r^vJc$?m+;e_v z>KJpt5@s-l#7`o!4c?G;N~kpGktHa}i~C|}U)(k>_J0I?Lijl}LCQE!FP}zq9A7ty z<{tc!%HIFt!R)tRceP@e7AU<_HvU!d8&eo`S9yz?4ZHI$a;LkV$vtENc}}}lozXR$ z8Q3$7e`(r*YMGu@Uu*Lb%tP|kzD7Z+9k!=onYL}N*o?<9fG5xd>5EK`id|C-7iQ)L zQqGkmep$rFSFnQ(6xG3Q 8): + return 'accurate' + return 'inaccurate' + +def _training_model(): + return randint(1, 10) + +with DAG("my_dag", start_date=datetime(2024, 1, 1), + schedule_interval="@daily", catchup=False) as dag: + + training_model_A = PythonOperator( + task_id="training_model_A", + python_callable=_training_model + ) + + training_model_B = PythonOperator( + task_id="training_model_B", + python_callable=_training_model + ) + + training_model_C = PythonOperator( + task_id="training_model_C", + python_callable=_training_model + ) + + choose_best_model = BranchPythonOperator( + task_id="choose_best_model", + python_callable=_choose_best_model + ) + + accurate = BashOperator( + task_id="accurate", + bash_command="echo 'accurate'" + ) + + inaccurate = BashOperator( + task_id="inaccurate", + bash_command="echo 'inaccurate'" + ) + + + [training_model_A, training_model_B, training_model_C] >> choose_best_model >> [accurate, inaccurate] \ No newline at end of file diff --git a/airflow/logs/scheduler/latest b/airflow/logs/scheduler/latest index 51e6f68..a394665 120000 --- a/airflow/logs/scheduler/latest +++ b/airflow/logs/scheduler/latest @@ -1 +1 @@ -2024-05-26 \ No newline at end of file +2024-06-11 \ No newline at end of file