mik-laj commented on code in PR #22852:
URL: https://github.com/apache/airflow/pull/22852#discussion_r846090383
##########
airflow/providers/google/cloud/hooks/dataproc.py:
##########
@@ -324,12 +332,20 @@ def create_cluster(
labels = labels or {}
labels.update({'airflow-version': 'v' + airflow_version.replace('.',
'-').replace('+', '-')})
- cluster = {
- "project_id": project_id,
- "cluster_name": cluster_name,
- "config": cluster_config,
- "labels": labels,
- }
+ cluster = (
+ {
+ "project_id": project_id,
+ "cluster_name": cluster_name,
+ "virtual_cluster_config": virtual_cluster_config,
+ }
+ if run_in_gke_cluster
+ else {
+ "project_id": project_id,
+ "cluster_name": cluster_name,
+ "config": cluster_config,
+ "labels": labels,
+ }
+ )
Review Comment:
```suggestion
cluster = {
"project_id": project_id,
"cluster_name": cluster_name,
"virtual_cluster_config": virtual_cluster_config,
}
if virtual_cluster_config is not None:
cluster['virtual_cluster_config'] = virtual_cluster_config
if cluster_config is not None:
cluster['config'] = cluster_config
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]