@@ -121,7 +121,7 @@ def progress_callback(
121121 ):
122122 previous_display_html = ""
123123 current_display_id = str (random .random ())
124- current_display = display .HTML ("Starting execution ." )
124+ current_display = display .HTML ("Starting." )
125125 display .display (
126126 current_display ,
127127 display_id = current_display_id ,
@@ -153,7 +153,12 @@ def progress_callback(
153153 )
154154 elif isinstance (event , bigframes .core .events .ExecutionFinished ):
155155 display .update_display (
156- display .HTML (f"{ previous_display_html } Execution done." ),
156+ display .HTML (f"✅ Completed. { previous_display_html } " ),
157+ display_id = current_display_id ,
158+ )
159+ elif isinstance (event , bigframes .core .events .SessionClosed ):
160+ display .update_display (
161+ display .HTML (f"Session { event .session_id } closed." ),
157162 display_id = current_display_id ,
158163 )
159164 elif progress_bar == "terminal" :
@@ -231,9 +236,7 @@ def render_query_references(
231236 request_id : Optional [str ],
232237) -> str :
233238 query_id = ""
234- if job_id :
235- query_id = f" with job ID { project_id } :{ location } .{ job_id } "
236- elif request_id :
239+ if request_id and not job_id :
237240 query_id = f" with request ID { project_id } :{ location } .{ request_id } "
238241 return query_id
239242
@@ -250,7 +253,7 @@ def render_job_link_html(
250253 job_id = job_id ,
251254 )
252255 if job_url :
253- job_link = f' <a target="_blank" href="{ job_url } ">Open Job</a>'
256+ job_link = f' [ <a target="_blank" href="{ job_url } ">Job { project_id } : { location } . { job_id } details </a>] '
254257 else :
255258 job_link = ""
256259 return job_link
@@ -268,7 +271,7 @@ def render_job_link_plaintext(
268271 job_id = job_id ,
269272 )
270273 if job_url :
271- job_link = f" Open Job: { job_url } "
274+ job_link = f" Job { project_id } : { location } . { job_id } details : { job_url } "
272275 else :
273276 job_link = ""
274277 return job_link
@@ -440,12 +443,12 @@ def render_bqquery_finished_event_html(
440443
441444 bytes_str = ""
442445 if event .total_bytes_processed is not None :
443- bytes_str = f" { humanize .naturalsize (event .total_bytes_processed )} processed. "
446+ bytes_str = f" { humanize .naturalsize (event .total_bytes_processed )} "
444447
445448 slot_time_str = ""
446449 if event .slot_millis is not None :
447450 slot_time = datetime .timedelta (milliseconds = event .slot_millis )
448- slot_time_str = f" Slot time: { humanize .naturaldelta (slot_time )} . "
451+ slot_time_str = f" in { humanize .naturaldelta (slot_time )} of slot time "
449452
450453 job_link = render_job_link_html (
451454 project_id = event .billing_project ,
@@ -459,7 +462,7 @@ def render_bqquery_finished_event_html(
459462 request_id = None ,
460463 )
461464 return f"""
462- Query{ query_id } finished. { bytes_str } { slot_time_str } { job_link }
465+ Query processed { bytes_str } { slot_time_str } { query_id } . { job_link }
463466 """
464467
465468
0 commit comments