TobKed commented on a change in pull request #8550:
URL: https://github.com/apache/airflow/pull/8550#discussion_r503980870
##########
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:
Since it is not strictly related changed and I don't want to block this
PR I deleted this part of logic and created separated PR for handling waiting
and timeout in job cancel: https://github.com/apache/airflow/pull/11501 (draft
because I must add tests).
----------------------------------------------------------------
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]