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:
[email protected]


Reply via email to