Skip to content

Commit

Permalink
chore(samples): fix job polling (#314)
Browse files Browse the repository at this point in the history
* Fix job polling

* Update submit_job_to_cluster.py

Co-authored-by: Anthonios Partheniou <partheniou@google.com>
  • Loading branch information
medb and parthea authored Jan 17, 2022
1 parent 48aaf55 commit 96052f6
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ def wait_for_job(dataproc, project, region, job_id):
request={"project_id": project, "region": region, "job_id": job_id}
)
# Handle exceptions
if job.status.State.Name(job.status.state) == "ERROR":
if job.status.State(job.status.state).name == "ERROR":
raise Exception(job.status.details)
elif job.status.State.Name(job.status.state) == "DONE":
if job.status.State(job.status.state).name == "DONE":
print("Job finished.")
return job

Expand Down

0 comments on commit 96052f6

Please sign in to comment.