Skip to content
This repository was archived by the owner on May 7, 2026. It is now read-only.

Commit b28c4e8

Browse files
committed
chore: Make the name of the colab endpoint unique between BigQuery and Spanner. This avoids clashes if the same notebook uses visualizers for both BigQuery graphs and Spanner graphs, which can cause malfunctions in the visualizers.
1 parent 4aea24d commit b28c4e8

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

bigquery_magics/bigquery.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -680,9 +680,11 @@ def _add_graph_widget(query_result):
680680
try:
681681
from google.colab import output
682682

683-
output.register_callback("graph_visualization.Query", _colab_query_callback)
684683
output.register_callback(
685-
"graph_visualization.NodeExpansion", _colab_node_expansion_callback
684+
"bigquery.graph_visualization.Query", _colab_query_callback
685+
)
686+
output.register_callback(
687+
"bigquery.graph_visualization.NodeExpansion", _colab_node_expansion_callback
686688
)
687689

688690
# In colab mode, the Javascript doesn't use the port value we pass in, as there is no
@@ -703,6 +705,13 @@ def _add_graph_widget(query_result):
703705
port=port,
704706
params=query_result.to_json().replace("\\", "\\\\").replace('"', '\\"'),
705707
)
708+
html_content = html_content.replace(
709+
'"graph_visualization.Query"', '"bigquery.graph_visualization.Query"'
710+
)
711+
html_content = html_content.replace(
712+
'"graph_visualization.NodeExpansion"',
713+
'"bigquery.graph_visualization.NodeExpansion"',
714+
)
706715
IPython.display.display(IPython.core.display.HTML(html_content))
707716

708717

0 commit comments

Comments
 (0)