File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
bigquery/google/cloud/bigquery Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -444,13 +444,16 @@ def _cell_magic(line, query):
444
444
else :
445
445
max_results = None
446
446
447
- if not re .search (r"\s" , query .rstrip ()):
448
- table_id = query .rstrip ()
449
-
447
+ query = query .strip ()
448
+
449
+ # Any query that does not contain whitespace (aside from leading and trailing whitespace)
450
+ # is assumed to be a table id
451
+ if not re .search (r"\s" , query ):
450
452
try :
451
- rows = client .list_rows (table_id , max_results = max_results )
453
+ rows = client .list_rows (query , max_results = max_results )
452
454
except Exception as ex :
453
- return _print_error (str (ex ), args .destination_var )
455
+ _print_error (str (ex ), args .destination_var )
456
+ return
454
457
455
458
result = rows .to_dataframe (bqstorage_client = bqstorage_client )
456
459
if args .destination_var :
You can’t perform that action at this time.
0 commit comments