-
Notifications
You must be signed in to change notification settings - Fork 5
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
aa28ec1
commit 8062dd5
Showing
2 changed files
with
39 additions
and
0 deletions.
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,34 @@ | ||
from datetime import datetime | ||
|
||
from airflow import DAG | ||
from airflow.decorators import task | ||
from airflow.models import Param | ||
|
||
with DAG( | ||
dag_id="RD-WATCH-AIRFLOW-DEMO-DAG", | ||
description="Test DAG", | ||
params={ | ||
"region_id": Param( | ||
default="BR_R002", type="string", pattern=r"^[A-Z]{2}_[RCST]\d{3}$" | ||
), | ||
"model_run_title": Param(default="test_run", type="string"), | ||
}, | ||
start_date=datetime(2022, 3, 1), | ||
catchup=False, | ||
schedule_interval=None, | ||
max_active_runs=1, | ||
default_view="grid", | ||
tags=["demo", "watch", "ta2", "rgd", "random"], | ||
) as dag1: | ||
|
||
@task | ||
def print_region(**context): | ||
region_id = context["params"]["region_id"] | ||
print(f"region_id: {region_id}") | ||
|
||
@task | ||
def print_model_run_title(**context): | ||
model_run_title = context["params"]["model_run_title"] | ||
print(f"model_run_title: {model_run_title}") | ||
|
||
print_region() >> print_model_run_title() |
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