Skip to content

Commit daf234b

Browse files
authored
Remove reference to deprecated operator in example_dataproc (#19619)
1 parent 264cb09 commit daf234b

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

airflow/providers/google/cloud/example_dags/example_dataproc.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
from datetime import datetime
2525

2626
from airflow import models
27-
from airflow.contrib.operators.dataproc_operator import DataprocClusterCreateOperator
2827
from airflow.providers.google.cloud.operators.dataproc import (
2928
ClusterGenerator,
3029
DataprocCreateClusterOperator,
@@ -66,11 +65,11 @@
6665

6766
# [END how_to_cloud_dataproc_create_cluster]
6867

69-
# Cluster definition: Generating Cluster Config for DataprocClusterCreateOperator
68+
# Cluster definition: Generating Cluster Config for DataprocCreateClusterOperator
7069
# [START how_to_cloud_dataproc_create_cluster_generate_cluster_config]
7170
path = "gs://goog-dataproc-initialization-actions-us-central1/python/pip-install.sh"
7271

73-
CLUSTER_CONFIG = ClusterGenerator(
72+
CLUSTER_GENERATOR_CONFIG = ClusterGenerator(
7473
project_id="test",
7574
zone="us-central1-a",
7675
master_machine_type="n1-standard-4",
@@ -81,12 +80,12 @@
8180
metadata={'PIP_PACKAGES': 'pyyaml requests pandas openpyxl'},
8281
).make()
8382

84-
create_cluster_operator = DataprocClusterCreateOperator(
83+
create_cluster_operator = DataprocCreateClusterOperator(
8584
task_id='create_dataproc_cluster',
8685
cluster_name="test",
8786
project_id="test",
8887
region="us-central1",
89-
cluster_config=CLUSTER_CONFIG,
88+
cluster_config=CLUSTER_GENERATOR_CONFIG,
9089
)
9190
# [END how_to_cloud_dataproc_create_cluster_generate_cluster_config]
9291

0 commit comments

Comments
 (0)