From a06a56856134662b71b1286abb93655e4bb2ddd6 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 4 Feb 2026 19:24:14 +0000 Subject: [PATCH 1/2] Remove bqsql magic registration and references Removes the `%%bqsql` magic alias, including its registration in `__init__.py`, references in documentation (README.rst, magics.rst, docstrings), and unit tests. This magic was an alias for `%%bigquery`. Co-authored-by: tswast <247555+tswast@users.noreply.github.com> --- README.rst | 12 ------------ bigquery_magics/__init__.py | 1 - bigquery_magics/bigquery.py | 4 ++-- docs/magics.rst | 2 +- tests/unit/bigquery/test_bigquery.py | 1 - 5 files changed, 3 insertions(+), 17 deletions(-) diff --git a/README.rst b/README.rst index 8eba9fe..dd8f041 100644 --- a/README.rst +++ b/README.rst @@ -101,15 +101,3 @@ Perform a query GROUP BY name ORDER BY count DESC LIMIT 3 - -Since BigQuery supports Python via BigQuery DataFrames, `%%bqsql` is offered as -an alias to clarify the language of these cells. - -.. code:: python - - %%bqsql - SELECT name, SUM(number) as count - FROM 'bigquery-public-data.usa_names.usa_1910_current' - GROUP BY name - ORDER BY count DESC - LIMIT 3 diff --git a/bigquery_magics/__init__.py b/bigquery_magics/__init__.py index 72efe92..c539012 100644 --- a/bigquery_magics/__init__.py +++ b/bigquery_magics/__init__.py @@ -30,7 +30,6 @@ def load_ipython_extension(ipython): ipython.register_magic_function( _cell_magic, magic_kind="cell", magic_name="bigquery" ) - ipython.register_magic_function(_cell_magic, magic_kind="cell", magic_name="bqsql") global is_registered is_registered = True diff --git a/bigquery_magics/bigquery.py b/bigquery_magics/bigquery.py index c60f327..daad88e 100644 --- a/bigquery_magics/bigquery.py +++ b/bigquery_magics/bigquery.py @@ -14,13 +14,13 @@ """IPython Magics -.. function:: ``%%bigquery`` or ``%%bqsql`` +.. function:: ``%%bigquery`` IPython cell magic to run a query and display the result as a DataFrame .. code-block:: python - %%bqsql [] [--project ] [--use_legacy_sql] + %%bigquery [] [--project ] [--use_legacy_sql] [--verbose] [--params ] diff --git a/docs/magics.rst b/docs/magics.rst index 2a029e4..41f5194 100644 --- a/docs/magics.rst +++ b/docs/magics.rst @@ -8,7 +8,7 @@ in a Jupyter notebook cell. %load_ext bigquery_magics -This makes the ``%%bigquery`` and ``%%bqsql`` magics available. +This makes the ``%%bigquery`` magic available. Code Samples ------------ diff --git a/tests/unit/bigquery/test_bigquery.py b/tests/unit/bigquery/test_bigquery.py index d5206c1..53da8b2 100644 --- a/tests/unit/bigquery/test_bigquery.py +++ b/tests/unit/bigquery/test_bigquery.py @@ -341,7 +341,6 @@ def test__create_dataset_if_necessary_not_exist(): ("magic_name",), ( ("bigquery",), - ("bqsql",), ), ) def test_extension_load(magic_name): From c8b87d47aab46baaa5ecd4c0fef9181606642c25 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 4 Feb 2026 19:35:04 +0000 Subject: [PATCH 2/2] Remove bqsql magic registration and references Removes the `%%bqsql` magic alias, including its registration in `__init__.py`, references in documentation (README.rst, magics.rst, docstrings), and unit tests. This magic was an alias for `%%bigquery`. Co-authored-by: tswast <247555+tswast@users.noreply.github.com> --- tests/unit/bigquery/test_bigquery.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/unit/bigquery/test_bigquery.py b/tests/unit/bigquery/test_bigquery.py index 53da8b2..6393d6d 100644 --- a/tests/unit/bigquery/test_bigquery.py +++ b/tests/unit/bigquery/test_bigquery.py @@ -339,9 +339,7 @@ def test__create_dataset_if_necessary_not_exist(): @pytest.mark.parametrize( ("magic_name",), - ( - ("bigquery",), - ), + (("bigquery",),), ) def test_extension_load(magic_name): globalipapp.start_ipython()