You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/09/10 08:10:16 UTC

[GitHub] [airflow] turbaszek commented on a change in pull request #10847: Add on_kill method to DataprocSubmitJobOperator

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



##########
File path: airflow/providers/google/cloud/operators/dataproc.py
##########
@@ -1808,6 +1808,8 @@ def __init__(
         gcp_conn_id: str = "google_cloud_default",
         impersonation_chain: Optional[Union[str, Sequence[str]]] = None,
         asynchronous: bool = False,
+        hook: Optional[DataprocHook] = None,

Review comment:
       The general idea is that operators should initialize the hook in execute methods. What users should pass in operators constructor is parameters for hook initialization (in this case `gcp_conn_id` and `impersonation_chain`).
   
   This operator can use only `DataprocHook` using any other hook may result in strange errors. Recommended way to to create "custom behavior" in Airflow is creating new operators.




----------------------------------------------------------------
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:
users@infra.apache.org