Comments (14)
At this point, going to close this item as "Will not fix" due to competing priorities.
from python-bigquery.
it is not possible to retry the job from within the library
@pietrodn It is possible to retry the job from within the library, for that need to use client.create_job
method which creates a new 'job ID' on every retry.
python-bigquery/google/cloud/bigquery/client.py
Line 1594 in 5a422eb
from python-bigquery.
@tswast I'm pretty sure that this is a back-end issue: the API shouldn't be returning '400 Bad Request' for internal server errors. Can you confirm?
from python-bigquery.
@shollyman Is this related to another BigQuery backend rollout?
from python-bigquery.
I agree that 400 Bad Request is the wrong response code for this error.
from python-bigquery.
I've filed bug 124319762 internally to track this issue. I see several similar reports internally, so this is likely not new behavior.
@bencaine1 If you have a support plan, I recommend filing a ticket with them to raise the priority of this issue on the BigQuery backend.
from python-bigquery.
@tswast Do you want to leave this issue open (i.e., do you imagine we will be making changes here to work around the 400?).
from python-bigquery.
Let's close this. The client workaround would be to look for certain text in the response body and ignore the response code, which I'd prefer not to do if we can avoid it.
from python-bigquery.
I saw this error again today. Has the underlying BigQuery issue been fixed? Is there another new issue with the same symptom?
If this bug continues to recur with various BigQuery bugs, I think there is (sadly) a case for having the client retry, because otherwise the non-Google customer application becomes responsible for retrying. That seems ... worse.
from python-bigquery.
Backend issue was closed as infeasible. Backend engineers say:
Connection error is the only retryable error returned as a job result, so you only need to add the logic to retry
jobs.insert()
ifjobs.getQueryResult()
returns 400 and the error reason set to the "jobBackendError" (which means that the job failed with the connection error), but I don't think you can reuse the job id for this case.
Since the job ID cannot be reused, this error is one that requires the whole job to be retried from the beginning. I think it's reasonable to do this, though will likely a bit difficult to do, as the failure won't be discovered until .result()
is called.
from python-bigquery.
If the error reason is "jobBackendError", it should be definitely be included in the BigQuery error table, so that developers can deal with it appropriately.
from python-bigquery.
If the job ID is not reusable, and it is not possible to retry the job from within the library, google-cloud-bigquery
could catch this BadRequest
exception and re-raise is as an InternalServerError
exception, so that the application code using the library can easily retry the whole class of server errors transparently.
from python-bigquery.
google-cloud-bigquery could catch this BadRequest exception and re-raise is as an InternalServerError exception,
I think this is a reasonable feature request.
from python-bigquery.
Some requirements for a custom exception:
- Backwards compatible -- inherit from the Google API error base class
- Preserves stacktrace -- use the exception wrapping mechanism to preserve all the context from the original exception.
- Clear that it's a BigQuery-related custom exception from the name. Example: BigQueryServerError.
- The message of this exception includes a code snippet on how to recreate the query job (to retry it) with
Client.create_job
.
from python-bigquery.
Related Issues (20)
- Raised `ArrowTypeError` should indicates which column is causing the error HOT 3
- Importing bigquery disables python garbage collector HOT 4
- Add slot_ms to the Python QueryPlanEntry class HOT 1
- protobuf-4.25.3 is incompatible with the library and results in an import error HOT 3
- Bug introduced in v3.12.0 HOT 8
- Warning: a recent release failed
- shapely >= 2.0.0 not supported for google-cloud-bigquery = "^2.x.x" with extras pandas HOT 2
- NULL is incorrectly introduced in previously working query HOT 11
- Warning: a recent release failed HOT 1
- Warning: a recent release failed HOT 1
- Warning: a recent release failed HOT 1
- .create_table method not working on BigQuery, if the table is an ibis table HOT 2
- `load_table_from_dataframe` doesn't respect `schema` fields order when specified HOT 2
- `query_and_wait` use in `Cursor.execute` breaks `default_query_job_config` in SQLAlchemy BQ Dialect HOT 2
- get_iam_policy and set_iam_policy are missing doc strings
- pyarrow import error in 3.20.0 HOT 9
- Support string_dtype, etc. in to_geodataframe HOT 2
- perf: don't retry getQueryResults as often with ambiguous errors in `QueryJob.result()` HOT 2
- Natural language support in BigQuery HOT 1
- AttributeError: module 'google._upb._message' has no attribute 'MessageMapContainer' HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-bigquery.