in src/redash_stmo/query_runner/big_query.py [0:0]
def _get_job_data(self, query):
job_data = super(BigQuery, self)._get_job_data(query)
labels = {"App": "redash"}
# Add the Owner label with the current user's email address
if self._query_user is not None:
labels["Owner"] = self._query_user.email
# Add all the parsed query metadata as labels to the job
parsed_annotation = parse_annotated_query(query)
labels.update(parsed_annotation)
# Add a full URL to the query for the "Name" label
if "Query ID" in parsed_annotation:
host = base_url(current_org)
labels["Name"] = "{host}/queries/{query_id}".format(
host=host, query_id=parsed_annotation["Query ID"]
)
if labels:
job_data["labels"] = labels
return job_data