diff --git a/bigquery_magics/bigquery.py b/bigquery_magics/bigquery.py index 4a00b74..839e104 100644 --- a/bigquery_magics/bigquery.py +++ b/bigquery_magics/bigquery.py @@ -91,9 +91,6 @@ import time import warnings -import IPython # type: ignore -from IPython import display # type: ignore -from IPython.core import magic_arguments # type: ignore import IPython # type: ignore from IPython import display # type: ignore from IPython.core import magic_arguments # type: ignore @@ -114,7 +111,6 @@ IPYTHON_USER_AGENT = "ipython-{}".format(IPython.__version__) context = bigquery_magics.config.context -context = bigquery_magics.config.context def _handle_error(error, destination_var=None): @@ -351,15 +347,6 @@ def _create_dataset_if_necessary(client, dataset_id): "Defaults to location set in query setting in console." ), ) -@magic_arguments.argument( - "--location", - type=str, - default=None, - help=( - "Set the location to execute query." - "Defaults to location set in query setting in console." - ), -) def _cell_magic(line, query): """Underlying function for bigquery cell magic @@ -404,8 +391,6 @@ def _cell_magic(line, query): ) use_bqstorage_api = not args.use_rest_api and (bigquery_storage is not None) location = args.location - use_bqstorage_api = not args.use_rest_api and (bigquery_storage is not None) - location = args.location params = [] if params_option_value: @@ -435,7 +420,6 @@ def _cell_magic(line, query): client_info=client_info.ClientInfo(user_agent=IPYTHON_USER_AGENT), client_options=bigquery_client_options, location=location, - location=location, ) if context._connection: client._connection = context._connection @@ -667,4 +651,4 @@ def _close_transports(client, bqstorage_client): """ client.close() if bqstorage_client is not None: - bqstorage_client._transport.grpc_channel.close() \ No newline at end of file + bqstorage_client._transport.grpc_channel.close() diff --git a/docs/index.rst b/docs/index.rst index 500c67a..d5ebb10 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -37,7 +37,6 @@ of this library (from ``1.x`` to ``2.x``, or from ``2.x`` to ``3.x``). .. toctree:: :maxdepth: 2 - UPGRADING Changelog --------- diff --git a/docs/magics.rst b/docs/magics.rst index aa14c6b..bb708c9 100644 --- a/docs/magics.rst +++ b/docs/magics.rst @@ -15,14 +15,14 @@ Code Samples Running a query: -.. literalinclude:: ./samples/magics/query.py +.. literalinclude:: ./samples/snippets/query.py :dedent: 4 :start-after: [START bigquery_jupyter_query] :end-before: [END bigquery_jupyter_query] Running a parameterized query: -.. literalinclude:: ./samples/magics/query_params_scalars.py +.. literalinclude:: ./samples/snippets/query_params_scalars.py :dedent: 4 :start-after: [START bigquery_jupyter_query_params_scalars] :end-before: [END bigquery_jupyter_query_params_scalars]