GoogleCloudPlatform / GoogleCloudPlatform/training-data-analyst

"Vertex AI: Qwik Start" notebook fails in "Exploratory data analysis (EDA) in BigQuery"

Open
#2,110 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
8.6k
Forks
6.1k
Avg merge
4h 44m
Merged PRs (30d)
2

Description

Executing [this cell](https://github.com/GoogleCloudPlatform/training-data-analyst/blob/master/self-paced-labs/vertex-ai/vertex-ai-qwikstart/lab_exercise.ipynb?short_path=b244057#L328-L342)
```
%%bigquery recency

SELECT
days_since_last_purchase
FROM
`online_retail.online_retail_clv_ml`
```
fails with the error `'_Plugin' object has no attribute '_stored_ctx'`.

Full backtrace

```
Query is running: 0%| | 0/1 [00:00
----> 1 get_ipython().run_cell_magic('bigquery', 'recency', '\nSELECT \n days_since_last_purchase\nFROM \n `online_retail.online_retail_clv_ml`\n')

/opt/conda/lib/python3.7/site-packages/IPython/core/interactiveshell.py in run_cell_magic(self, magic_name, line, cell)
2470 with self.builtin_trap:
2471 args = (magic_arg_s, cell)
-> 2472 result = fn(*args, **kwargs)
2473 return result
2474

/opt/conda/lib/python3.7/site-packages/google/cloud/bigquery/magics/magics.py in _cell_magic(line, query)
711 return
712
--> 713 if not args.verbose:
714 display.clear_output()
715

/opt/conda/lib/python3.7/site-packages/google/cloud/bigquery/job/query.py in to_dataframe(self, bqstorage_client, dtypes, progress_bar_type, create_bqstorage_client, date_as_object, max_results, geography_as_object)
1700 intermediate shuffle and spilled to disk.
1701 """
-> 1702 return _helpers._int_or_none(self._properties.get("shuffleOutputBytesSpilled"))
1703
1704 @property

/opt/conda/lib/python3.7/site-packages/google/cloud/bigquery/table.py in to_dataframe(self, bqstorage_client, dtypes, progress_bar_type, create_bqstorage_client, date_as_object, geography_as_object)
1986
1987 if start is not None:
-> 1988 self.start = start
1989 if end is not None:
1990 self.end = end

/opt/conda/lib/python3.7/site-packages/google/cloud/bigquery/table.py in to_arrow(self, progress_bar_type, bqstorage_client, create_bqstorage_client)
1778 # If changing the signature of this method, make sure to apply the same
1779 # changes to job.QueryJob.to_dataframe()
-> 1780 def to_dataframe(
1781 self,
1782 bqstorage_client: "bigquery_storage.BigQueryReadClient" = None,

/opt/conda/lib/python3.7/site-packages/google/cloud/bigquery/table.py in _to_page_iterable(self, bqstorage_download, tabledata_list_download, bqstorage_client)
1633
1634 This method requires the ``pyarrow`` and
-> 1635 ``google-cloud-bigquery-storage`` libraries.
1636
1637 This method only exposes a subset of the capabilities of the

/opt/conda/lib/python3.7/site-packages/google/cloud/bigquery/_pandas_helpers.py in _download_table_bqstorage(project_id, table, bqstorage_client, preserve_order, selected_fields, page_to_item, max_queue_size)
753 )
754
--> 755
756 def download_dataframe_bqstorage(
757 project_id,

/opt/conda/lib/python3.7/site-packages/google/cloud/bigquery_storage_v1/services/big_query_read/client.py in create_read_session(self, request, parent, read_session, max_stream_count, retry, timeout, metadata)
624 retry=retry,
625 timeout=timeout,
--> 626 metadata=metadata,
627 )
628

/opt/conda/lib/python3.7/site-packages/google/api_core/gapic_v1/method.py in __call__(self, timeout, retry, *args, **kwargs)
152 kwargs["metadata"] = metadata
153
--> 154 return wrapped_func(*args, **kwargs)
155
156

/opt/conda/lib/python3.7/site-packages/google/api_core/retry.py in retry_wrapped_func(*args, **kwargs)
286 sleep_generator,
287 self._deadline,
--> 288 on_error=on_error,
289 )
290

/opt/conda/lib/python3.7/site-packages/google/api_core/retry.py in retry_target(target, predicate, sleep_generator, deadline, on_error)
188 for sleep in sleep_generator:
189 try:
--> 190 return target()
191
192 # pylint: disable=broad-except

/opt/conda/lib/python3.7/site-packages/google/api_core/grpc_helpers.py in error_remapped_callable(*args, **kwargs)
55 callable_.__name__ = callable_.__class__.__name__
56
---> 57
58 def _wrap_unary_errors(callable_):
59 """Map errors for Unary-Unary and Stream-Unary gRPC callables."""

/opt/conda/lib/python3.7/site-packages/grpc/_channel.py in __call__(self, request, timeout, metadata, credentials, wait_for_ready, compression)
943 state, operations, deadline, rendezvous = self._prepare(
944 request, timeout, metadata, wait_for_ready, compression)
--> 945 if state is None:
946 raise rendezvous # pylint: disable-msg=raising-bad-type
947 else:

/opt/conda/lib/python3.7/site-packages/grpc/_channel.py in _blocking(self, request, timeout, metadata, credentials, wait_for_ready, compression)
931 compression=None):
932 state, call, = self._blocking(request, timeout, metadata, credentials,
--> 933 wait_for_ready, compression)
934 return _end_unary_response_blocking(state, call, True, None)
935

src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi in grpc._cython.cygrpc.SegregatedCall.next_event()

src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi in grpc._cython.cygrpc._next_call_event()

src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi in grpc._cython.cygrpc._next_call_event()

src/python/grpcio/grpc/_cython/_cygrpc/completion_queue.pyx.pxi in grpc._cython.cygrpc._latent_event()

src/python/grpcio/grpc/_cython/_cygrpc/completion_queue.pyx.pxi in grpc._cython.cygrpc._internal_latent_event()

src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi in grpc._cython.cygrpc._get_metadata()

AttributeError: '_Plugin' object has no attribute '_stored_ctx'
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.