From b2afbb5b29f20b10ce0b998b294ab51982dad8e9 Mon Sep 17 00:00:00 2001 From: Henry J Solberg Date: Fri, 13 Oct 2023 18:14:08 +0000 Subject: [PATCH 1/3] style: improve cancellation string --- bigframes/formatting_helpers.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bigframes/formatting_helpers.py b/bigframes/formatting_helpers.py index f3e3a76ce4..57c4246a7f 100644 --- a/bigframes/formatting_helpers.py +++ b/bigframes/formatting_helpers.py @@ -155,7 +155,9 @@ def wait_for_query_job( raise except KeyboardInterrupt: query_job.cancel() - print(f"Requested cancelation for {query_job.job_type} {query_job.job_id}...") + print( + f"Requested cancellation for {query_job.job_type.capitalize()} job {query_job.job_id}..." + ) # begin the cancel request before immediately rethrowing raise @@ -197,7 +199,9 @@ def wait_for_job(job: GenericJob, progress_bar: Optional[str] = None): raise except KeyboardInterrupt: job.cancel() - print(f"Requested cancelation for {job.job_type} {job.job_id}...") + print( + f"Requested cancellation for {job.job_type.capitalize()} job {job.job_id}..." + ) # begin the cancel request before immediately rethrowing raise From 469d0d9ff5fdb991d2d2e30441caba8766bd7211 Mon Sep 17 00:00:00 2001 From: Henry J Solberg Date: Fri, 13 Oct 2023 18:25:03 +0000 Subject: [PATCH 2/3] add location to cancellation string --- bigframes/formatting_helpers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bigframes/formatting_helpers.py b/bigframes/formatting_helpers.py index 57c4246a7f..b80614db33 100644 --- a/bigframes/formatting_helpers.py +++ b/bigframes/formatting_helpers.py @@ -156,7 +156,7 @@ def wait_for_query_job( except KeyboardInterrupt: query_job.cancel() print( - f"Requested cancellation for {query_job.job_type.capitalize()} job {query_job.job_id}..." + f"Requested cancellation for {query_job.job_type.capitalize()} job {query_job.job_id} in location {query_job.location}..." ) # begin the cancel request before immediately rethrowing raise @@ -200,7 +200,7 @@ def wait_for_job(job: GenericJob, progress_bar: Optional[str] = None): except KeyboardInterrupt: job.cancel() print( - f"Requested cancellation for {job.job_type.capitalize()} job {job.job_id}..." + f"Requested cancellation for {job.job_type.capitalize()} job {job.job_id} in location {job.location}..." ) # begin the cancel request before immediately rethrowing raise From c0f45d7570e54875639b49a0e3931c58d76cd89e Mon Sep 17 00:00:00 2001 From: Henry J Solberg Date: Fri, 13 Oct 2023 18:32:35 +0000 Subject: [PATCH 3/3] split cancellation string to two lines of code --- bigframes/formatting_helpers.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bigframes/formatting_helpers.py b/bigframes/formatting_helpers.py index b80614db33..6851bdd2bd 100644 --- a/bigframes/formatting_helpers.py +++ b/bigframes/formatting_helpers.py @@ -156,7 +156,8 @@ def wait_for_query_job( except KeyboardInterrupt: query_job.cancel() print( - f"Requested cancellation for {query_job.job_type.capitalize()} job {query_job.job_id} in location {query_job.location}..." + f"Requested cancellation for {query_job.job_type.capitalize()}" + f" job {query_job.job_id} in location {query_job.location}..." ) # begin the cancel request before immediately rethrowing raise @@ -200,7 +201,8 @@ def wait_for_job(job: GenericJob, progress_bar: Optional[str] = None): except KeyboardInterrupt: job.cancel() print( - f"Requested cancellation for {job.job_type.capitalize()} job {job.job_id} in location {job.location}..." + f"Requested cancellation for {job.job_type.capitalize()}" + f" job {job.job_id} in location {job.location}..." ) # begin the cancel request before immediately rethrowing raise