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 2021/04/18 06:57:09 UTC

[GitHub] [airflow] xinbinhuang commented on a change in pull request #15250: [Airflow-15245] - passing custom image family name to the DataProcClusterCreateoperator

xinbinhuang commented on a change in pull request #15250:
URL: https://github.com/apache/airflow/pull/15250#discussion_r615352784



##########
File path: airflow/providers/google/cloud/operators/dataproc.py
##########
@@ -346,6 +358,16 @@ def _build_cluster_data(self):
             if not self.single_node:
                 cluster_data['worker_config']['image_uri'] = custom_image_url
 
+        elif self.custom_image_family:
+            project_id = self.custom_image_project_id or self.project_id
+            custom_image_url = (
+                'https://www.googleapis.com/compute/beta/projects/'
+                '{}/global/images/family/{}'.format(project_id, self.custom_image_family)

Review comment:
       Let's use f-string here
   ```suggestion
                   f'{project_id}/global/images/family/{self.custom_image_family}'
   ```




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