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

Add --params option to %%bigquery magic #6277

Merged
merged 8 commits into from
Oct 30, 2018
Prev Previous commit
Next Next commit
clarify --params docstring
  • Loading branch information
guillermo-carrasco committed Oct 30, 2018
commit 396381ba19a62322aba37ef4ad852ac5aa870386
12 changes: 3 additions & 9 deletions bigquery/google/cloud/bigquery/magics.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@
query is finished. By default, this information will be displayed but
will be cleared after the query is finished.
* ``--params <params dictionary>`` (optional, line argument):
If present, the argument must be a parsable JSON string. This dictionary
will be used to format values preceded by ``@`` in the query.
If present, the argument must be a parsable JSON string or a reference to dictionary
which is serializable to JSON (preceding the dictionary with $).
This dictionary will be used to format values preceded by ``@`` in the query.
* ``<query>`` (required, cell argument):
SQL query to run.

Expand Down Expand Up @@ -104,13 +105,6 @@
Out[5]:
...: num
...: 0 17
In [6]: # Expand a dictionary instead of writing it's string value
In [6]: params = {"num": 17}
In [7]: %%bigquery df --params $params
...: SELECT @num AS num
Out[7]:
...: num
...: 0 17
"""

alixhami marked this conversation as resolved.
Show resolved Hide resolved
from __future__ import print_function
Expand Down