Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uninformative Jupyter cell magic error if the query is missing #57

Closed
plamut opened this issue Mar 10, 2020 · 0 comments · Fixed by #58
Closed

Uninformative Jupyter cell magic error if the query is missing #57

plamut opened this issue Mar 10, 2020 · 0 comments · Fixed by #58
Assignees
Labels
api: bigquery Issues related to the googleapis/python-bigquery API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@plamut
Copy link
Contributor

plamut commented Mar 10, 2020

Environment details

BigQuery client v1.24.0, all Python versions.

Steps to reproduce

  1. Fire up a Jupyter notebook or an IPython session and load the bigquery extension:

     %load_ext google.cloud.bigquery
    
  2. Use the bigquery cell magic without specifying the query:

    %%bigquery --project my-project --destination_table my_dataset.my_table
    

Actual result:
An error message is displayed, but is kind of misleading:

ERROR:
 table_id must be a fully-qualified ID in standard SQL format, e.g., "project.dataset.table_id", got 

It might make the user wonder why the table ID is incorrect even if --destination is correctly specified.

Expected result:
The error message should explain that the query is missing in the cell body.

Proposed solution

The current implementation assumes that any query without whitespace represents a table ID, but it fails to check if the query is non-empty in the first place. The latter check should be added.

@plamut plamut added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p2 Moderately-important priority. Fix may not be included in next release. labels Mar 10, 2020
@plamut plamut self-assigned this Mar 10, 2020
@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/python-bigquery API. label Mar 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant