DataProcHook cancel method does not execute the REST call
See original GitHub issueApache Airflow version: 1.10.x
What happened: The cancel method of the DataProcHook does not cancel a running DataProc job.
What you expected to happen: The job should get cancelled and return the response JSON Documentation says: returns A Job json dictionary representing the canceled job: https://github.com/apache/airflow/blob/1.10.11/airflow/contrib/hooks/gcp_dataproc_hook.py#L325
What do you think went wrong: The cancel method in the hook only creates the googleapiclient.http.HttpRequest object and returns it. It should call execute on the object and return the response.
It can be fixed by: https://github.com/apache/airflow/blob/1.10.11/airflow/contrib/hooks/gcp_dataproc_hook.py#L336
return self.get_conn().projects().regions().jobs().cancel(
projectId=project_id,
region=region,
jobId=job_id
).execute(num_retries=self.num_retries)
How to reproduce it: Submit a dataproc job and call an Airflow operator to cancel the job. It returns the request object instead of the JSON
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (6 by maintainers)
Thanks @potiuk . I completely understand. I will be moving to the 2.0 ports.
Should we close this issue?