Skip to content

Commit

Permalink
Remove reference to deprecated operator in example_dataproc (#19619)
Browse files Browse the repository at this point in the history
  • Loading branch information
josh-fell authored Nov 16, 2021
1 parent 264cb09 commit daf234b
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
from datetime import datetime

from airflow import models
from airflow.contrib.operators.dataproc_operator import DataprocClusterCreateOperator
from airflow.providers.google.cloud.operators.dataproc import (
ClusterGenerator,
DataprocCreateClusterOperator,
Expand Down Expand Up @@ -66,11 +65,11 @@

# [END how_to_cloud_dataproc_create_cluster]

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

CLUSTER_CONFIG = ClusterGenerator(
CLUSTER_GENERATOR_CONFIG = ClusterGenerator(
project_id="test",
zone="us-central1-a",
master_machine_type="n1-standard-4",
Expand All @@ -81,12 +80,12 @@
metadata={'PIP_PACKAGES': 'pyyaml requests pandas openpyxl'},
).make()

create_cluster_operator = DataprocClusterCreateOperator(
create_cluster_operator = DataprocCreateClusterOperator(
task_id='create_dataproc_cluster',
cluster_name="test",
project_id="test",
region="us-central1",
cluster_config=CLUSTER_CONFIG,
cluster_config=CLUSTER_GENERATOR_CONFIG,
)
# [END how_to_cloud_dataproc_create_cluster_generate_cluster_config]

Expand Down

0 comments on commit daf234b

Please sign in to comment.
  翻译: