FrankYang0529 commented on PR #74523:
URL: https://github.com/apache/airflow/pull/74523#issuecomment-6263873433

   Thanks for the suggestion. The label term between tasks is more clear. I 
switched to following syntax:
   
   ```java
   loaded.before(Label.of("when empty").on(reportEmpty), Label.of("when 
suspicious").on(reportSuspicious));
   ```
   
   About Python syntax:
   - `a >> Label("forks") >> [b, c]` labels both edges.
   - `a >> [Label("x") >> b, Label("y") >> c]` draws both edges but labels 
neither, and raises no error. When `Label("x") >> b` runs, the label has no 
upstream yet, and the expression returns `b`. So the outer expression is just 
`a >> [b, c]`.
   
   `on` can take several tasks, so the first form maps to:
   
   ```java
   loaded.before(Label.of("forks").on(reportEmpty, reportSuspicious)); // a >> 
Label("forks") >> [b, c]
   ```
   
   To keep the text between the tasks, I did not add `loaded.labeled("forks")`. 
`after` also works with the same syntax:
   
   ```java
   cleaned.after(Label.of("always").on(loaded)); // load >> Label("always") >> 
cleanup
   ```
   
   The Go SDK (`airflow.Label(node, text)`) and the TS SDK (`label(node, 
text)`) both put the task first. Should those two SDKs follow the Java syntax?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to