Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd663104

Browse files
committed
added comment and updated to use strip instead of rstrip
1 parent7a13ca4 commitd663104

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

‎bigquery/google/cloud/bigquery/magics.py‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -444,13 +444,16 @@ def _cell_magic(line, query):
444444
else:
445445
max_results=None
446446

447-
ifnotre.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+
ifnotre.search(r"\s",query):
450452
try:
451-
rows=client.list_rows(table_id,max_results=max_results)
453+
rows=client.list_rows(query,max_results=max_results)
452454
exceptExceptionasex:
453-
return_print_error(str(ex),args.destination_var)
455+
_print_error(str(ex),args.destination_var)
456+
return
454457

455458
result=rows.to_dataframe(bqstorage_client=bqstorage_client)
456459
ifargs.destination_var:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp