turbaszek commented on a change in pull request #10847:
URL: https://github.com/apache/airflow/pull/10847#discussion_r486240748



##########
File path: airflow/providers/google/cloud/operators/dataproc.py
##########
@@ -1834,15 +1838,19 @@ def execute(self, context: Dict):
             timeout=self.timeout,
             metadata=self.metadata,
         )
-        job_id = job_object.reference.job_id
-        self.log.info('Job %s submitted successfully.', job_id)
+        self.job_id = job_object.reference.job_id
+        self.log.info('Job %s submitted successfully.', self.job_id)
 
         if not self.asynchronous:
-            self.log.info('Waiting for job %s to complete', job_id)
-            hook.wait_for_job(job_id=job_id, location=self.location, 
project_id=self.project_id)
-            self.log.info('Job %s completed successfully.', job_id)
+            self.log.info('Waiting for job %s to complete', self.job_id)
+            self.hook.wait_for_job(job_id=self.job_id, location=self.location, 
project_id=self.project_id)
+            self.log.info('Job %s completed successfully.', self.job_id)
+
+        return self.job_id

Review comment:
       Looks good! What would you say to limit number of changes by adding 
`self.job_id = job_id` before return? 




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


Reply via email to