Skip to content

Commit 27020f8

Browse files
authored
Add try clause to DataFusionHook.wait_for_pipeline_state (#10031)
Sometimes it may happen that the pipeline is not visible instantly in DataFusion so retrieving it will result in 404 closes: #10030
1 parent 85cc2a6 commit 27020f8

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

β€Žairflow/providers/google/cloud/hooks/datafusion.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,15 @@ def wait_for_pipeline_state(
112112
start_time = monotonic()
113113
current_state = None
114114
while monotonic() - start_time < timeout:
115-
current_state = self._get_workflow_state(
116-
pipeline_name=pipeline_name,
117-
pipeline_id=pipeline_id,
118-
instance_url=instance_url,
119-
namespace=namespace,
120-
)
121-
115+
try:
116+
current_state = self._get_workflow_state(
117+
pipeline_name=pipeline_name,
118+
pipeline_id=pipeline_id,
119+
instance_url=instance_url,
120+
namespace=namespace,
121+
)
122+
except AirflowException:
123+
pass # Because the pipeline may not be visible in system yet
122124
if current_state in success_states:
123125
return
124126
if current_state in failure_states:

0 commit comments

Comments
 (0)