Skip to content

BigQuery: [magics] if destination_var is set and an error occurs, save the QueryJob for further inspection #9091

@tswast

Description

@tswast

Is your feature request related to a problem? Please describe.

When an error occurs, it's useful to have a QueryJob object to inspect the errors properties, as well as check for other details about the job that may have caused the failure. At the very least, a job ID is needed if one wants to file a support ticket about the failure.

Describe the solution you'd like

As identified in #9067 (review), when an error occurs with a %%bigquery magic, it would be useful to save the query job object for further inspection of the error and the rest of the job.

A problem with this is that in successful cases destination_var will be a pandas DataFrame, but in failure cases destination_var will be a QueryJob object. Since the magics are primarily used interactively, this probably isn't that much of a problem.

Describe alternatives you've considered

Print out the job ID and have the user call client.get_job() in order to inspect the object. This does not work in the case of dry run queries, as no job resource is saved in the backend.

Metadata

Metadata

Assignees

Labels

api: bigqueryIssues related to the BigQuery API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions