Merged
Changes from all commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Failed to load files.
Original file line numberDiff line numberDiff line change
Expand Up@@ -153,6 +153,11 @@ def wait_for_query_job(
except api_core_exceptions.GoogleAPICallError as exc:
add_feedback_link(exc)
raise
except KeyboardInterrupt:
query_job.cancel()
print(f"Requested cancelation for {query_job.job_type} {query_job.job_id}...")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kinda nitpick - English vocab is not my forte but I wondered about "cancelation" vs "cancellation" and looks like in googleapis repos the former is a rarity, the latter is commonly used.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kinda nitpick - English vocab is not my forte but I wondered about "cancelation" vs "cancellation" and looks like in googleapis repos the former is a rarity, the latter is commonly used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Shobhit, created #111 to address these.

# begin the cancel request before immediately rethrowing
raise


def wait_for_job(job: GenericJob, progress_bar: Optional[str] = None):
Expand DownExpand Up@@ -190,6 +195,11 @@ def wait_for_job(job: GenericJob, progress_bar: Optional[str] = None):
except api_core_exceptions.GoogleAPICallError as exc:
add_feedback_link(exc)
raise
except KeyboardInterrupt:
job.cancel()
print(f"Requested cancelation for {job.job_type} {job.job_id}...")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may like to follow the following pattern done elsewhere for consistency:

  1. job_type.capitalize() like in get_base_job_loading_*
  2. "<job_type> job <job_id>" instead of "<job_type> <job_id>", like in get_*_job_loading_*

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Shobhit, created #111 to address these.

# begin the cancel request before immediately rethrowing
raise


def get_job_url(query_job: GenericJob):
Expand Down