File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
airflow/providers/google/cloud/example_dags Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 24
24
from datetime import datetime
25
25
26
26
from airflow import models
27
- from airflow .contrib .operators .dataproc_operator import DataprocClusterCreateOperator
28
27
from airflow .providers .google .cloud .operators .dataproc import (
29
28
ClusterGenerator ,
30
29
DataprocCreateClusterOperator ,
66
65
67
66
# [END how_to_cloud_dataproc_create_cluster]
68
67
69
- # Cluster definition: Generating Cluster Config for DataprocClusterCreateOperator
68
+ # Cluster definition: Generating Cluster Config for DataprocCreateClusterOperator
70
69
# [START how_to_cloud_dataproc_create_cluster_generate_cluster_config]
71
70
path = "gs://goog-dataproc-initialization-actions-us-central1/python/pip-install.sh"
72
71
73
- CLUSTER_CONFIG = ClusterGenerator (
72
+ CLUSTER_GENERATOR_CONFIG = ClusterGenerator (
74
73
project_id = "test" ,
75
74
zone = "us-central1-a" ,
76
75
master_machine_type = "n1-standard-4" ,
81
80
metadata = {'PIP_PACKAGES' : 'pyyaml requests pandas openpyxl' },
82
81
).make ()
83
82
84
- create_cluster_operator = DataprocClusterCreateOperator (
83
+ create_cluster_operator = DataprocCreateClusterOperator (
85
84
task_id = 'create_dataproc_cluster' ,
86
85
cluster_name = "test" ,
87
86
project_id = "test" ,
88
87
region = "us-central1" ,
89
- cluster_config = CLUSTER_CONFIG ,
88
+ cluster_config = CLUSTER_GENERATOR_CONFIG ,
90
89
)
91
90
# [END how_to_cloud_dataproc_create_cluster_generate_cluster_config]
92
91
You can’t perform that action at this time.
0 commit comments