-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Bigquery Jobs should match the Futures interface #3556
Copy link
Copy link
Closed
Labels
api: bigqueryIssues related to the BigQuery API.Issues related to the BigQuery API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.Important issue which blocks shipping the next release. Will be fixed prior to next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.
Metadata
Metadata
Assignees
Labels
api: bigqueryIssues related to the BigQuery API.Issues related to the BigQuery API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.Important issue which blocks shipping the next release. Will be fixed prior to next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.
Presently, bigquery uses a custom
Jobclass (and subclasses) to deal with long-running operations such as queries and data import.The Job class causes the proliferation of code like this around all of our samples and user code:
Which in terms means our samples require a level on indirection to accomplish simple tasks:
However, our gax-based clients share a common "Long Running Operation" strategy that surfaces these types of on-going operations as a class that implements the
concurrent.futures.Futureinterface. This is implemented asgax._OperationFuture. bigquery unfortunately can not use this as it's an http-only API and gax can only currently be used for gRPC APIs.We should make the
_BaseJobclass and its subclasses closely conform to theFutureinterface so that the usage is similar to other API client and so that we can simplify usage to: