dependencies_states.py 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. # Licensed to the Apache Software Foundation (ASF) under one
  2. # or more contributor license agreements. See the NOTICE file
  3. # distributed with this work for additional information
  4. # regarding copyright ownership. The ASF licenses this file
  5. # to you under the Apache License, Version 2.0 (the
  6. # "License"); you may not use this file except in compliance
  7. # with the License. You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing,
  12. # software distributed under the License is distributed on an
  13. # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  14. # KIND, either express or implied. See the License for the
  15. # specific language governing permissions and limitations
  16. # under the License.
  17. from __future__ import annotations
  18. from airflow.utils.state import TaskInstanceState
  19. EXECUTION_STATES = {
  20. TaskInstanceState.RUNNING,
  21. TaskInstanceState.QUEUED,
  22. }
  23. # In order to be able to get queued a task must have one of these states
  24. SCHEDULEABLE_STATES = {
  25. None,
  26. TaskInstanceState.UP_FOR_RETRY,
  27. TaskInstanceState.UP_FOR_RESCHEDULE,
  28. }
  29. RUNNABLE_STATES = {
  30. # For cases like unit tests and run manually
  31. None,
  32. TaskInstanceState.UP_FOR_RETRY,
  33. TaskInstanceState.UP_FOR_RESCHEDULE,
  34. # For normal scheduler/backfill cases
  35. TaskInstanceState.QUEUED,
  36. }
  37. QUEUEABLE_STATES = {
  38. TaskInstanceState.SCHEDULED,
  39. }
  40. BACKFILL_QUEUEABLE_STATES = {
  41. # For cases like unit tests and run manually
  42. None,
  43. TaskInstanceState.UP_FOR_RESCHEDULE,
  44. TaskInstanceState.UP_FOR_RETRY,
  45. # For normal backfill cases
  46. TaskInstanceState.SCHEDULED,
  47. }