ashb commented on a change in pull request #5079: [AIRFLOW-4285] Update task
dependency context defination and usage
URL: https://github.com/apache/airflow/pull/5079#discussion_r288183330
##########
File path: airflow/ti_deps/dep_context.py
##########
@@ -88,43 +88,85 @@ def __init__(
# In order to be able to get queued a task must have one of these states
-QUEUEABLE_STATES = {
- State.FAILED,
+SCHEDULEABLE_STATES = {
State.NONE,
+ State.UP_FOR_RETRY,
+ State.UP_FOR_RESCHEDULE,
+}
+
+RUNNABLE_STATES = {
+ # For cases like unit tests and run manually
+ State.NONE,
+ State.UP_FOR_RETRY,
+ State.UP_FOR_RESCHEDULE,
+ # For normal scheduler/backfill cases
State.QUEUED,
+}
+
+QUEUEABLE_STATES = {
State.SCHEDULED,
- State.SKIPPED,
- State.UPSTREAM_FAILED,
- State.UP_FOR_RETRY,
+}
+
+BACKFILL_QUEUEABLE_STATES = {
+ # For cases like unit tests and run manually
+ State.NONE,
State.UP_FOR_RESCHEDULE,
+ State.UP_FOR_RETRY,
+ # For normal backfill cases
+ State.SCHEDULED,
}
-# Context to get the dependencies that need to be met in order for a task
instance to
-# be backfilled.
-QUEUE_DEPS = {
- NotRunningDep(),
- NotSkippedDep(),
+# Context to get the dependencies that need to be met in order for a task
instance to be
+# set to 'scheduled' state.
+SCHEDULED_DEPS = {
RunnableExecDateDep(),
- ValidStateDep(QUEUEABLE_STATES),
+ ValidStateDep(SCHEDULEABLE_STATES),
+}
+
+# Dependencies that if not met, task instance should be re-queued.
Review comment:
```suggestion
# Dependencies that if met, task instance should be re-queued.
```
I think?
----------------------------------------------------------------
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]
With regards,
Apache Git Services