Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

chore(samples): fix job polling #314

Merged
merged 4 commits into from
Jan 17, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions samples/snippets/submit_job_to_cluster.py
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":
elif job.status.State(job.status.state).name == "DONE":
print("Job finished.")
return job

Expand Down