I want to branch out my Dataform workflow. Say, there are 3 different sets of tasks:
Set 1 = [Task_1.sqlx, Task_2.sqlx, Task_3.sqlx]
Set 2 = [Task_4.sqlx, Task_5.sqlx]
Set 3 = [Task_6.sqlx, Task_7.sqlx, Task_8.sqlx]
I want to run either one (or two or all) sets based on a certain condition. Is it possible to evaluate the condition, determine which set(s) to run, and execute those sets within a single workflow in Dataform (just like Airflow Branch Python Operator returns the set of tasks to be run based on a condition)?
I am not able to come up with an approach, so, I tried putting my condition in the form of an assertion. Failure of the assertion would mean that a particular task won't run, but then, this approach has certain shortcomings:
1. We need to have as many assertions as the branches we need
2. When an assertion fails, the overall status of the workflow is also "failed" which could be slightly misleading.
Besides, I believe, assertions are mainly designed for data quality checks and not conditional triggering.
Is there a way to work around this issue?
Maybe a short hint, Try to group your SQLX files based on the tags and then execute based on the tags from composer. Meanwhile you can decide which tags to execute in the composer.