diff --git a/UPGRADING.md b/UPGRADING.md index 28d1f396..dd7c2f3c 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -149,4 +149,20 @@ from google.cloud import dataproc status = dataproc.ClusterStatus.State.CREATING cluster = dataproc.Cluster(cluster_name="name") +``` + +## Path Helper Methods +The following path helper methods have been removed. Please construct the paths manually. + +```py +project = 'my-project' +location = 'project-location' +region = 'project-region' +workflow_template = 'template' +autoscaling_policy = 'policy' + +location_path = f'projects/{project}/locations/{location}' +region_path = f'projects/{project}/regions/{region}' +workflow_template_path = f'projects/{project}/regions/{region}/workflowTemplates/{workflow_template}' +autoscaling_policy_path = f'projects/{project}/locations/{location}/autoscalingPolicies/{autoscaling_policy}' ``` \ No newline at end of file diff --git a/samples/snippets/create_cluster.py b/samples/snippets/create_cluster.py index f5973083..732b349a 100644 --- a/samples/snippets/create_cluster.py +++ b/samples/snippets/create_cluster.py @@ -39,7 +39,7 @@ def create_cluster(project_id, region, cluster_name): # Create a client with the endpoint set to the desired cluster region. cluster_client = dataproc.ClusterControllerClient( - client_options={"api_endpoint": f"{region}-dataproc.googleapis.com:443",} + client_options={"api_endpoint": f"{region}-dataproc.googleapis.com:443"} ) # Create the cluster config. diff --git a/samples/snippets/quickstart/quickstart.py b/samples/snippets/quickstart/quickstart.py index 362016c7..ba93993e 100644 --- a/samples/snippets/quickstart/quickstart.py +++ b/samples/snippets/quickstart/quickstart.py @@ -77,9 +77,9 @@ def quickstart(project_id, region, cluster_name, job_file_path): # Termimal states for a job. terminal_states = { - dataproc.JobStatus.ERROR, - dataproc.JobStatus.CANCELLED, - dataproc.JobStatus.DONE, + dataproc.JobStatus.State.ERROR, + dataproc.JobStatus.State.CANCELLED, + dataproc.JobStatus.State.DONE, } # Create a timeout such that the job gets cancelled if not in a