-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
673e9c4
commit 9ae2d23
Showing
4 changed files
with
69 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
Binary file not shown.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
from airflow import DAG | ||
from airflow.operators.python import PythonOperator, BranchPythonOperator | ||
from airflow.operators.bash import BashOperator | ||
from datetime import datetime | ||
from random import randint | ||
|
||
|
||
def _choose_best_model(ti): | ||
accuracies = ti.xcom_pull(task_ids=[ | ||
'training_model_A', | ||
'training_model_B', | ||
'training_model_C' | ||
]) | ||
best_accuracy = max(accuracies) | ||
if (best_accuracy > 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] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2024-05-26 | ||
2024-06-11 |