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/12/08 12:25:52 UTC

[GitHub] [airflow] otourzan commented on a change in pull request #12907: Add regional support to the workflow template methods.

otourzan commented on a change in pull request #12907:
URL: https://github.com/apache/airflow/pull/12907#discussion_r538308549



##########
File path: airflow/providers/google/cloud/hooks/dataproc.py
##########
@@ -218,11 +217,14 @@ def get_cluster_client(self, location: Optional[str] = None) -> ClusterControlle
             credentials=self._get_credentials(), client_info=self.client_info, client_options=client_options
         )
 
-    @cached_property
-    def get_template_client(self) -> WorkflowTemplateServiceClient:
+    def get_template_client(self, location: Optional[str] = None) -> WorkflowTemplateServiceClient:
         """Returns WorkflowTemplateServiceClient."""
+        client_options = None
+        if location and location != 'global':

Review comment:
       If template is in global namespace, region (location) parameter needed to be set to 'global' as required for template path [1], [2].
   
   [1]: https://github.com/apache/airflow/blob/8c42cf1b00c90f0d7f11b8a3a455381de8e003c5/airflow/providers/google/cloud/hooks/dataproc.py#L645
   [2]: https://github.com/googleapis/python-dataproc/blob/7ec92b71be9c1d0d305421bb1b1dce5d92377bba/google/cloud/dataproc_v1beta2/services/workflow_template_service/client.py#L155




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