turbaszek commented on a change in pull request #10847:
URL: https://github.com/apache/airflow/pull/10847#discussion_r486150692
##########
File path: airflow/providers/google/cloud/operators/dataproc.py
##########
@@ -1834,15 +1838,24 @@ 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
- return job_id
+ def on_kill(self, cancel_on_kill: bool = True, job_id: str = ''):
+ if not cancel_on_kill:
Review comment:
```suggestion
if not self.cancel_on_kill:
```
This param should be added to operator constructor and assigned ther as
operator attribute `self.cancel_on_kill = cancel_on_kill`.
----------------------------------------------------------------
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]