def _run_query(self, query):
query_request = self.service.jobs()<EOL>logger.debug('<STR_LIT>', query)<EOL>start = datetime.now()<EOL>resp = query_request.query(<EOL>projectId=self.project_id, body={'<STR_LIT>': query}<EOL>).execute()<EOL>duration = datetime.now() - start<EOL>logger.debug('<STR_LIT>', duration, resp)<EOL>if not resp['<STR_LIT>']:<EOL><INDENT>logger.error('<STR_LIT>')<EOL><DEDENT>if int(resp['<STR_LIT>']) == <NUM_LIT:0>:<EOL><INDENT>return []<EOL><DEDENT>if int(resp['<STR_LIT>']) != len(resp['<STR_LIT>']):<EOL><INDENT>logger.error('<STR_LIT>'<EOL>'<STR_LIT>', resp['<STR_LIT>'], len(resp['<STR_LIT>']))<EOL><DEDENT>data = []<EOL>fields = [f['<STR_LIT:name>'] for f in resp['<STR_LIT>']['<STR_LIT>']]<EOL>for row in resp['<STR_LIT>']:<EOL><INDENT>d = {}<EOL>for idx, val in enumerate(row['<STR_LIT:f>']):<EOL><INDENT>d[fields[idx]] = val['<STR_LIT:v>']<EOL><DEDENT>data.append(d)<EOL><DEDENT>return data<EOL>
Run one query against BigQuery and return the result.

:param query: the query to run
:type query: str
:return: list of per-row response dicts (key => value)
:rtype: ``list``