Skip to content

Commit

Permalink
Remove workaround for query_next misbehaving.
Browse files Browse the repository at this point in the history
Now that
googleapis/google-api-python-client#1403 is
fixed, remove the workaround.

Fixes: b/190349928
Change-Id: Ia278d6aefa9508be548888a1bc2d83fa59a12541
  • Loading branch information
schweikert committed Jun 21, 2021
1 parent 8caa0b2 commit ee9fee7
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions gcp_doctor/queries/monitoring.py
Expand Up @@ -166,19 +166,8 @@ def query(context: models.Context, query_str: str) -> TimeSeriesCollection:
pages += 1
response = request.execute()
time_series.add_api_response(response)
# Workaround for
# https://github.com/googleapis/google-api-python-client/issues/1403
if 'nextPageToken' in response and response['nextPageToken']:
request = mon_api.projects().timeSeries().query(
name='projects/' + project_id,
body={
'query': query_str,
'pageToken': response['nextPageToken']
})
else:
break
#request = mon_api.projects().timeSeries().query_next(
# previous_request=request, previous_response=response)
request = mon_api.projects().timeSeries().query_next(
previous_request=request, previous_response=response)
end_time = datetime.datetime.now()
logging.debug('query run time: %s, pages: %d', end_time - start_time,
pages)
Expand Down

0 comments on commit ee9fee7

Please sign in to comment.