I couldn't find the exact same question in stack-overflow. Apologies, if this is a repeated question. I am using this code snippet to pass query to a table.
_body = {'_query':'SELECT * FROM `<projectId>.<datasetId>.<tableId>`',
'useLegacySql': False,
'maxResults': 100
}
table = _bq.jobs().query(projectId= <projectId>,alt = "json", body = _body).execute()
I am passing all the required arguments, since using jobs.query API, I am getting status code 200, with the results, but while integrating the snippet in python program, I get following error:
File "D:\Applications\Python27\lib\site-packages\oauth2client\_helpers.py", line 133, in positional_wrapper\n return wrapped(*args, **kwargs)\n', ' File "D:\Applications\Python27\lib\site-packages\googleapiclient\http.py", line 842, in execute\n raise HttpError(resp, content, uri=self.uri)\n', 'HttpError: https://www.googleapis.com/bigquery/v2/projects/projectId/queries?alt=json returned "Required parameter is missing">\n']