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

Commit c12445a

Browse files
Use query parameter for info schema query
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent a98faab commit c12445a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

bigquery_magics/bigquery.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -663,9 +663,10 @@ def _get_graph_schema(
663663
info_schema_query = f"""
664664
select PROPERTY_GRAPH_METADATA_JSON
665665
FROM `{query_job.configuration.destination.project}.{dataset_id}`.INFORMATION_SCHEMA.PROPERTY_GRAPHS
666-
WHERE PROPERTY_GRAPH_NAME = "{graph_id}"
666+
WHERE PROPERTY_GRAPH_NAME = @graph_id
667667
"""
668-
info_schema_results = bq_client.query(info_schema_query).to_dataframe()
668+
job_config = bigquery.QueryJobConfig(query_parameters=[bigquery.ScalarQueryParameter("graph_id", "STRING", graph_id)])
669+
info_schema_results = bq_client.query(info_schema_query, job_config=job_config).to_dataframe()
669670

670671
if info_schema_results.shape == (1, 1):
671672
return graph_server._convert_schema(info_schema_results.iloc[0, 0])

0 commit comments

Comments
 (0)