Yeah, alright, I guess that makes sense.   Thank you both for the replies.

Maybe it's just confirmation bias in action, but it seems like I almost always 
see DAGs written like

```

with DAG(dag_id="simple", start_date=datetime(2022, 4, 1)) as dag:
    task1 = Operator1(task_id='task1')
    task2 = Operator1(task_id='task2')

    task3 = Operator1(task_id='task3')

    task1 >> task2 >> task3
```

and it feels so repetitive.  Maybe I'm just trivializing a change that is both 
unnecessary and largely intrusive.

Thanks for the replies.

________________________________
From: Jed Cunningham <[email protected]>
Sent: Wednesday, April 27, 2022 1:45 PM
To: [email protected]
Subject: RE: [EXTERNAL]task_id declarations


CAUTION: This email originated from outside of the organization. Do not click 
links or open attachments unless you can confirm the sender and know the 
content is safe.


Also keep in mind you don't even have to put tasks in a variable, for example:

```
with DAG(dag_id="simple", start_date=datetime(2022, 4, 1)) as dag:
    BashOperator(task_id="hello", bash_command="echo hello")
    BashOperator(task_id="world", bash_command="echo world")
```

Reply via email to