File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -156,6 +156,11 @@ def configuration_schema(cls):
156156 "secret" : ["jsonKeyFile" ],
157157 }
158158
159+ def annotate_query (self , query , metadata ):
160+ # Remove "Job ID" before annotating the query to avoid cache misses
161+ metadata = {k : v for k , v in metadata .items () if k != "Job ID" }
162+ return super ().annotate_query (query , metadata )
163+
159164 def _get_bigquery_service (self ):
160165 socket .setdefaulttimeout (settings .BIGQUERY_HTTP_TIMEOUT )
161166
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ def test_annotate_query_with_use_query_annotation_option(self):
2020 query = "SELECT a FROM tbl"
2121 expect = (
2222 "/* Username: username, query_id: adhoc, "
23- "Job ID: job-id, Query Hash: query-hash, "
23+ "Query Hash: query-hash, "
2424 "Scheduled: False */ SELECT a FROM tbl"
2525 )
2626
You can’t perform that action at this time.
0 commit comments