champon1020 commented on code in PR #34785:
URL: https://github.com/apache/airflow/pull/34785#discussion_r1348054361


##########
airflow/providers/google/cloud/hooks/dataflow.py:
##########
@@ -420,7 +420,9 @@ def _check_dataflow_job_state(self, job) -> bool:
                     "JOB_STATE_DRAINED while it is a batch job"
                 )
 
-        if not self._wait_until_finished and current_state == 
self._expected_terminal_state:
+        if current_state == self._expected_terminal_state:
+            if self._expected_terminal_state == 
DataflowJobStatus.JOB_STATE_RUNNING:
+                return not self._wait_until_finished

Review Comment:
   `_expected_terminal_state` is optional parameter indicating which state is 
considered as a success (discussed in 
https://github.com/apache/airflow/pull/8553#discussion_r416136954). 
   
   I think the coexistence of two similar parameters, `_wait_until_finished` 
and `_expected_terminal_state`, causes this weird implementation (What 
`_wait_until_finished` is True has the same meaning as what 
`_expected_terminal_state` is DataflowJobStatus.JOB_STATE_DONE). So, it would 
be better to remove `_wait_until_finished` if we adopt 
`_expected_terminal_state` :thinking: 
   



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

To unsubscribe, e-mail: commits-unsubscr...@airflow.apache.org

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

Reply via email to