mirror of
https://github.com/getredash/redash.git
synced 2025-12-19 17:37:19 -05:00
BigQuery: Remove "Job ID" metadata on annotaton to avoid cache misses (#7541)
This commit is contained in:
@@ -156,6 +156,11 @@ class BigQuery(BaseSQLQueryRunner):
|
|||||||
"secret": ["jsonKeyFile"],
|
"secret": ["jsonKeyFile"],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def annotate_query(self, query, metadata):
|
||||||
|
# Remove "Job ID" before annotating the query to avoid cache misses
|
||||||
|
metadata = {k: v for k, v in metadata.items() if k != "Job ID"}
|
||||||
|
return super().annotate_query(query, metadata)
|
||||||
|
|
||||||
def _get_bigquery_service(self):
|
def _get_bigquery_service(self):
|
||||||
socket.setdefaulttimeout(settings.BIGQUERY_HTTP_TIMEOUT)
|
socket.setdefaulttimeout(settings.BIGQUERY_HTTP_TIMEOUT)
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ class TestBigQueryQueryRunner(unittest.TestCase):
|
|||||||
query = "SELECT a FROM tbl"
|
query = "SELECT a FROM tbl"
|
||||||
expect = (
|
expect = (
|
||||||
"/* Username: username, query_id: adhoc, "
|
"/* Username: username, query_id: adhoc, "
|
||||||
"Job ID: job-id, Query Hash: query-hash, "
|
"Query Hash: query-hash, "
|
||||||
"Scheduled: False */ SELECT a FROM tbl"
|
"Scheduled: False */ SELECT a FROM tbl"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user