gusty icon indicating copy to clipboard operation
gusty copied to clipboard

Allow tasks to have dependencies on task groups and vice versa

Open bishopofbathandwells opened this issue 1 year ago • 2 comments

Currently, when we set a task to depend on a task group it doesn't work. Also, when setting a task group to depend on a task it doesn't work. It's not clear why either of these cases should be problematic. In fact, enjoy_breakfast.yml in the provided examples suggests their shouldn't be any issue.

Can anyone confirm whether there is some hidden complexity that I'm missing or if it should generally work as expected.

bishopofbathandwells avatar Dec 21 '23 00:12 bishopofbathandwells

Some further context, a task dependency on a task group works if they are at the same level in the folder hierarchy. However, it doesn't work if the task is within its own task group. E.g. if you push enjoy_breakfast.yml into its own task group the dependencies on the groups are not recognised.

bishopofbathandwells avatar Dec 21 '23 09:12 bishopofbathandwells

@bishopofbathandwells thanks for sharing. I've got the following tasks:

task_a

operator: airflow.operators.bash.BashOperator
bash_command: date

my_group/task_b

operator: airflow.operators.bash.BashOperator
bash_command: date
dependencies:
  - task_a

Where task_b.yml lives inside of a folder called my_group.

The following graph is being rendered with no dependency issues.

Screenshot 2024-01-17 at 11 34 57 AM

using gusty==0.21.0 and airflow==2.8.0

Where are you running into this issue? Maybe the issue is being caused by suffixes and prefixes in the breakfast DAG?

chriscardillo avatar Jan 17 '24 16:01 chriscardillo

@bishopofbathandwells - I am going to close this issue for now because of inactivity. I apologize for not answering initially, as my notifications for this repository were not active.

You can have task groups depend on each other by specifying a dependencies block in the METADATA.yml of those task group folders.

I hope this helps.

chriscardillo avatar Feb 06 '24 13:02 chriscardillo