kennknowles commented on a change in pull request #8553:
URL: https://github.com/apache/airflow/pull/8553#discussion_r416287771
##########
File path: airflow/providers/google/cloud/hooks/dataflow.py
##########
@@ -93,15 +94,30 @@ def inner_wrapper(self: "DataflowHook", *args, **kwargs) ->
RT:
class DataflowJobStatus:
"""
Helper class with Dataflow job statuses.
+ Reference:
https://cloud.google.com/dataflow/docs/reference/rest/v1b3/projects.jobs#Job.JobState
"""
- JOB_STATE_DONE = "JOB_STATE_DONE"
+ JOB_STATE_UNKNOWN = "JOB_STATE_UNKNOWN"
+ JOB_STATE_STOPPED = "JOB_STATE_STOPPED"
JOB_STATE_RUNNING = "JOB_STATE_RUNNING"
+ JOB_STATE_DONE = "JOB_STATE_DONE"
JOB_STATE_FAILED = "JOB_STATE_FAILED"
JOB_STATE_CANCELLED = "JOB_STATE_CANCELLED"
+ JOB_STATE_UPDATED = "JOB_STATE_UPDATED"
+ JOB_STATE_DRAINING = "JOB_STATE_DRAINING"
+ JOB_STATE_DRAINED = "JOB_STATE_DRAINED"
JOB_STATE_PENDING = "JOB_STATE_PENDING"
- FAILED_END_STATES = {JOB_STATE_FAILED, JOB_STATE_CANCELLED}
- SUCCEEDED_END_STATES = {JOB_STATE_DONE}
- END_STATES = SUCCEEDED_END_STATES | FAILED_END_STATES
+ JOB_STATE_CANCELLING = "JOB_STATE_CANCELLING"
+ JOB_STATE_QUEUED = "JOB_STATE_QUEUED"
+ FAILED_END_STATES = {JOB_STATE_FAILED, JOB_STATE_CANCELLED,
JOB_STATE_STOPPED}
+ SUCCEEDED_END_STATES = {JOB_STATE_DONE, JOB_STATE_UPDATED,
JOB_STATE_DRAINED}
+ TERMINAL_STATES = SUCCEEDED_END_STATES | FAILED_END_STATES
Review comment:
I do not know airflow that well. I just tried to see how these variables
were used. I missed the place where they actually affect the Airflow result. It
is a good idea to let the user say what they expect, and then a failure can be
anything else.
Example: we have had real use cases where we deliberately cancel jobs we do
not need anymore, and that can be success for streaming jobs.
I think the only certain failed state is JOB_STATE_FAILED.
----------------------------------------------------------------
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]