@@ -125,7 +125,7 @@ def __init__(self):
125125self ._default_query_job_config = bigquery .QueryJobConfig ()
126126self ._bigquery_client_options = client_options .ClientOptions ()
127127self ._bqstorage_client_options = client_options .ClientOptions ()
128- self ._progress_bar_type = "tqdm "
128+ self ._progress_bar_type = "tqdm_notebook "
129129
130130@property
131131def credentials (self ):
@@ -269,7 +269,7 @@ def progress_bar_type(self):
269269 Manually setting the progress_bar_type:
270270
271271 >>> from google.cloud.bigquery import magics
272- >>> magics.context.progress_bar_type = "tqdm "
272+ >>> magics.context.progress_bar_type = "tqdm_notebook "
273273 """
274274return self ._progress_bar_type
275275
@@ -286,7 +286,7 @@ def _handle_error(error, destination_var=None):
286286
287287 Args:
288288 error (Exception):
289- An exception that ocurred during the queryexectution .
289+ An exception that ocurred during the queryexecution .
290290 destination_var (Optional[str]):
291291 The name of the IPython session variable to store the query job.
292292 """
@@ -329,22 +329,25 @@ def _run_query(client, query, job_config=None):
329329 Query complete after 2.07s
330330 'bf633912-af2c-4780-b568-5d868058632b'
331331 """
332- start_time = time .time ()
332+ start_time = time .perf_counter ()
333333query_job = client .query (query ,job_config = job_config )
334334
335335if job_config and job_config .dry_run :
336336return query_job
337337
338- print ("Executing query with job ID: {}" . format ( query_job .job_id ) )
338+ print (f "Executing query with job ID:{ query_job .job_id } " )
339339
340340while True :
341- print ("\r Query executing: {:0.2f}s" .format (time .time ()- start_time ),end = "" )
341+ print (
342+ f"\r Query executing:{ time .perf_counter ()- start_time :.2f} s" .format (),
343+ end = "" ,
344+ )
342345try :
343346query_job .result (timeout = 0.5 )
344347break
345348except futures .TimeoutError :
346349continue
347- print (" \n Query complete after {:0.2f}s" . format ( time . time () - start_time ) )
350+ print (f" \n Job ID { query_job . job_id } successfully executed" )
348351return query_job
349352
350353
@@ -365,7 +368,7 @@ def _create_dataset_if_necessary(client, dataset_id):
365368pass
366369dataset = bigquery .Dataset (dataset_reference )
367370dataset .location = client .location
368- print ("Creating dataset: {}" . format ( dataset_id ) )
371+ print (f "Creating dataset:{ dataset_id } " )
369372dataset = client .create_dataset (dataset )
370373
371374
@@ -500,7 +503,7 @@ def _create_dataset_if_necessary(client, dataset_id):
500503default = None ,
501504help = (
502505"Sets progress bar type to display a progress bar while executing the query."
503- "Defaults to usetqdm . Install the ``tqdm`` package to use this feature."
506+ "Defaults to usetqdm_notebook . Install the ``tqdm`` package to use this feature."
504507 ),
505508)
506509def _cell_magic (line ,query ):