You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
BigQuery: no public method to retry/resubmit an existing job #5555
changed the title [-]BigQuery: add rateLimitExceeded as transient error to retry[/-][+]BigQuery: no public method to retry/resubmit an existing job[/+]on Jun 29, 2018
As luck with have it, PR #5552 (merged yesterday) moves the DEFAULT_RETRY policy into a new, public module: it does indeed retry rateLimitExceeded errors, and can be customized by users, e.g.:
We have been retrying existing jobs previously by taking a job config and resubmitting it with a new job id. This seemed to work previously, but we are now experiencing a new issue.
The _begin() method makes a call to _to_api_repr() which is now Abstract and raises an error.
def to_api_repr(self):
"""Generate a resource for the job."""
raise NotImplementedError("Abstract")
def _begin(self, client=None, retry=DEFAULT_RETRY):
"""API call: begin the job via a POST request
See
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/insert
:type client: :class:`~google.cloud.bigquery.client.Client` or
``NoneType``
:param client: the client to use. If not passed, falls back to the
``client`` stored on the current dataset.
:type retry: :class:`google.api_core.retry.Retry`
:param retry: (Optional) How to retry the RPC.
:raises: :exc:`ValueError` if the job has already begin.
"""
if self.state is not None:
raise ValueError("Job already begun.")
client = self._require_client(client)
path = "/projects/%s/jobs" % (self.project,)
# jobs.insert is idempotent because we ensure that every new
# job has an ID.
api_response = client._call_api(
retry, method="POST", path=path, data=self.to_api_repr()
)
self._set_properties(api_response)
If this is expected behavior, how should this be circumvented?
No much traction but I wonder if an optional arg resubmit_on_quota_hit in the result() function would not be ideal altogether.
Downside (is it ?) is that it would change the underlying job properties like jobId
Activity
[-]BigQuery: add rateLimitExceeded as transient error to retry[/-][+]BigQuery: no public method to retry/resubmit an existing job[/+]tseaver commentedon Jun 29, 2018
As luck with have it, PR #5552 (merged yesterday) moves the
DEFAULT_RETRYpolicy into a new, public module: it does indeed retryrateLimitExceedederrors, and can be customized by users, e.g.:yan-hic commentedon Jun 29, 2018
Not sure the PR helps. The retry is for inserting a job, not for resubmitting an existing job.
As per Tim: https://stackoverflow.com/questions/49926546/retry-an-update-in-bigquery-does-not-seem-to-work
dillonjohnson commentedon Mar 15, 2019
We have been retrying existing jobs previously by taking a job config and resubmitting it with a new job id. This seemed to work previously, but we are now experiencing a new issue.
The
_begin()method makes a call to_to_api_repr()which is now Abstract and raises an error.If this is expected behavior, how should this be circumvented?
tseaver commentedon Mar 19, 2019
@dillonjohnson Rather than
_AsyncJob, you need to instantiate one of the concrete job classes (e.g.,CopyJob,QueryJob, etc.)yan-hic commentedon Sep 2, 2019
No much traction but I wonder if an optional arg
resubmit_on_quota_hitin theresult()function would not be ideal altogether.Downside (is it ?) is that it would change the underlying job properties like
jobIdtswast commentedon Nov 12, 2019
Closing in favor of https://github.com/googleapis/google-cloud-python/issues/9781