You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/10/07 21:18:52 UTC

[GitHub] [airflow] mik-laj commented on a change in pull request #8550: Add DataflowStartFlexTemplateOperator

mik-laj commented on a change in pull request #8550:
URL: https://github.com/apache/airflow/pull/8550#discussion_r501315981



##########
File path: airflow/providers/google/cloud/hooks/dataflow.py
##########
@@ -282,41 +295,70 @@ def wait_for_done(self) -> None:
             time.sleep(self._poll_sleep)
             self._refresh_jobs()
 
-    def get_jobs(self) -> List[Dict]:
+    def get_jobs(self, refresh=False) -> List[Dict]:
         """
         Returns Dataflow jobs.
 
         :return: list of jobs
         :rtype: list
         """
-        if not self._jobs:
+        if not self._jobs or refresh:
             self._refresh_jobs()
         if not self._jobs:
             raise ValueError("Could not read _jobs")
 
         return self._jobs
 
+    def _wait_for_states(self, expected_states: Set[str]):
+        """
+        Waiting for the jobs to reach a certain state.
+        """
+        if not self._jobs:
+            raise ValueError("The _jobs should be set")
+        while True:

Review comment:
       We have timeout: See: https://airflow.readthedocs.io/en/latest/_api/airflow/models/index.html#airflow.models.BaseOperator -> `execution_timeout`




----------------------------------------------------------------
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:
users@infra.apache.org