You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/04/14 10:56:12 UTC

[GitHub] [airflow] ashb commented on pull request #15285: Fixed #9387: Add State types for tasks and DAGs

ashb commented on pull request #15285:
URL: https://github.com/apache/airflow/pull/15285#issuecomment-819428250


   > > if you want to make this an enum, why can't you just keep the single State class and make it enum, or enum-like?
   > 
   > I think that’d take away most of the reason of having an enum class. The main advantage of enums is to prevent invalid values from being passed (they’d result in a typing or runtime error). Combining all the possible state values into one enum means not all state values make sense for all contexts (some states are impossible on task instances, for example), and kind of defeats the purpose.
   
   Exactly this -- there are some states that only apply to TaskInstances, but that don't apply to DagRuns or (Base)Job classes -- "upstream_failed" for instance (there are more).


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org