- 3.36.0 (latest)
- 3.35.1
- 3.34.0
- 3.33.0
- 3.31.0
- 3.30.0
- 3.29.0
- 3.27.0
- 3.26.0
- 3.25.0
- 3.24.0
- 3.23.1
- 3.22.0
- 3.21.0
- 3.20.1
- 3.19.0
- 3.18.0
- 3.17.2
- 3.16.0
- 3.15.0
- 3.14.1
- 3.13.0
- 3.12.0
- 3.11.4
- 3.4.0
- 3.3.6
- 3.2.0
- 3.1.0
- 3.0.1
- 2.34.4
- 2.33.0
- 2.32.0
- 2.31.0
- 2.30.1
- 2.29.0
- 2.28.1
- 2.27.1
- 2.26.0
- 2.25.2
- 2.24.1
- 2.23.3
- 2.22.1
- 2.21.0
- 2.20.0
- 2.19.0
- 2.18.0
- 2.17.0
- 2.16.1
- 2.15.0
- 2.14.0
- 2.13.1
- 2.12.0
- 2.11.0
- 2.10.0
- 2.9.0
- 2.8.0
- 2.7.0
- 2.6.2
- 2.5.0
- 2.4.0
- 2.3.1
- 2.2.0
- 2.1.0
- 2.0.0
- 1.28.2
- 1.27.2
- 1.26.1
- 1.25.0
- 1.24.0
- 1.23.1
- 1.22.0
- 1.21.0
- 1.20.0
- 1.19.0
- 1.18.0
- 1.17.0
- 1.16.0
ExtractJob
(
job_id
,
source
,
destination_uris
,
client
,
job_config
=
None
)
Asynchronous job: extract data from a table into Cloud Storage.
Parameters
job_id
str
the job's ID.
source
Union[ google.cloud.bigquery.table.TableReference
, google.cloud.bigquery.model.ModelReference
]
Table or Model from which data is to be loaded or extracted.
destination_uris
List[str]
URIs describing where the extracted data will be written in Cloud Storage, using the format gs://<bucket_name>/<object_name_or_glob>
.
client
job_config
Optional[ google.cloud.bigquery.job.ExtractJobConfig
]
Extra configuration options for the extract job.
Inheritance
builtins.object > google.api_core.future.base.Future > google.api_core.future.polling.PollingFuture > google.cloud.bigquery.job.base._AsyncJob > ExtractJobProperties
compression
See compression .
created
Datetime at which the job was created.
Optional[datetime.datetime]
destination_format
See destination_format .
destination_uri_file_counts
Return file counts from job statistics, if present.
List[int]
destination_uris
List[str]: URIs describing where the extracted data will be
written in Cloud Storage, using the format gs://<bucket_name>/<object_name_or_glob>
.
ended
Datetime at which the job finished.
Optional[datetime.datetime]
error_result
Error information about the job as a whole.
Optional[Mapping]
errors
Information about individual errors generated by the job.
Optional[List[Mapping]]
etag
ETag for the job resource.
Optional[str]
field_delimiter
See field_delimiter .
job_id
str: ID of the job.
job_type
Type of job.
str
labels
Dict[str, str]: Labels for the job.
location
str: Location where the job runs.
num_child_jobs
The number of child jobs executed.
See: https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#JobStatistics.FIELDS.num_child_jobs
parent_job_id
Return the ID of the parent job.
See: https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#JobStatistics.FIELDS.parent_job_id
Optional[str]
path
URL path for the job's APIs.
str
print_header
See print_header .
project
Project bound to the job.
str
reservation_usage
Job resource usage breakdown by reservation.
script_statistics
Statistics for a child job of a script.
self_link
URL for the job resource.
Optional[str]
session_info
[Preview] Information of the session if this job is part of one.
.. versionadded:: 2.29.0
source
Union[ google.cloud.bigquery.table.TableReference , google.cloud.bigquery.model.ModelReference ]: Table or Model from which data is to be loaded or extracted.
started
Datetime at which the job was started.
Optional[datetime.datetime]
state
Status of the job.
Optional[str]
transaction_info
Information of the multi-statement transaction if this job is part of one.
Since a scripting query job can execute multiple transactions, this
property is only expected on child jobs. Use the list_jobs
method with the parent_job
parameter to iterate over child jobs.
.. versionadded:: 2.24.0
user_email
E-mail address of user who submitted the job.
Optional[str]
Methods
add_done_callback
add_done_callback
(
fn
)
Add a callback to be executed when the operation is complete.
If the operation is not already complete, this will start a helper thread to poll for the status of the operation in the background.
fn
Callable[Future]
The callback to execute when the operation is complete.
cancel
cancel
(
client
=
None
,
retry
:
retries
.
Retry
=
< google
.
api_core
.
retry
.
Retry
object
> ,
timeout
:
float
=
None
)
API call: cancel job via a POST request
See https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/cancel
timeout
Optional[float]
The number of seconds to wait for the underlying HTTP transport before using retry
client
Optional[ google.cloud.bigquery.client.Client
]
the client to use. If not passed, falls back to the client
stored on the current dataset.
retry
Optional[google.api_core.retry.Retry]
How to retry the RPC.
bool
cancelled
cancelled
()
Check if the job has been cancelled.
This always returns False. It's not possible to check if a job was
cancelled in the API. This method is here to satisfy the interface
for google.api_core.future.Future
.
bool
done
done
(
retry
:
retries
.
Retry
=
< google
.
api_core
.
retry
.
Retry
object
> ,
timeout
:
float
=
None
,
reload
:
bool
=
True
)
Checks if the job is complete.
timeout
Optional[float]
The number of seconds to wait for the underlying HTTP transport before using retry
.
reload
Optional[bool]
If True
, make an API call to refresh the job state of unfinished jobs before checking. Default True
.
retry
Optional[google.api_core.retry.Retry]
How to retry the RPC. If the job state is DONE
, retrying is aborted early, as the job will not change anymore.
bool
exception
exception
(
timeout
=
None
)
Get the exception from the operation, blocking if necessary.
timeout
int
How long to wait for the operation to complete. If None, wait indefinitely.
Optional[google.api_core.GoogleAPICallError]
exists
exists
(
client
=
None
,
retry
:
retries
.
Retry
=
< google
.
api_core
.
retry
.
Retry
object
> ,
timeout
:
float
=
None
)
API call: test for the existence of the job via a GET request
See https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/get
timeout
Optional[float]
The number of seconds to wait for the underlying HTTP transport before using retry
.
client
Optional[ google.cloud.bigquery.client.Client
]
the client to use. If not passed, falls back to the client
stored on the current dataset.
retry
Optional[google.api_core.retry.Retry]
How to retry the RPC.
bool
from_api_repr
from_api_repr
(
resource
:
dict
,
client
)
Factory: construct a job given its API representation
resource
Dict
dataset job representation returned from the API
client
google.cloud.bigquery.client.Client
Client which holds credentials and project configuration for the dataset.
google.cloud.bigquery.job.ExtractJob
resource
.reload
reload
(
client
=
None
,
retry
:
retries
.
Retry
=
< google
.
api_core
.
retry
.
Retry
object
> ,
timeout
:
float
=
None
)
API call: refresh job properties via a GET request.
See https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/get
timeout
Optional[float]
The number of seconds to wait for the underlying HTTP transport before using retry
.
client
Optional[ google.cloud.bigquery.client.Client
]
the client to use. If not passed, falls back to the client
stored on the current dataset.
retry
Optional[google.api_core.retry.Retry]
How to retry the RPC.
result
result
(
retry
:
retries
.
Retry
=
< google
.
api_core
.
retry
.
Retry
object
> ,
timeout
:
float
=
None
)
Start the job and wait for it to complete and get the result.
timeout
Optional[float]
The number of seconds to wait for the underlying HTTP transport before using retry
. If multiple requests are made under the hood, timeout
applies to each individual request.
retry
Optional[google.api_core.retry.Retry]
How to retry the RPC. If the job state is DONE
, retrying is aborted early, as the job will not change anymore.
google.cloud.exceptions.GoogleAPICallError
concurrent.futures.TimeoutError
_AsyncJob
running
running
()
True if the operation is currently running.
set_exception
set_exception
(
exception
)
Set the Future's exception.
set_result
set_result
(
result
)
Set the Future's result.
to_api_repr
to_api_repr
()
Generate a resource for _begin
.
__init__
__init__
(
job_id
,
source
,
destination_uris
,
client
,
job_config
=
None
)
Initialize self. See help(type(self)) for accurate signature.
ExtractJob
ExtractJob
(
job_id
,
source
,
destination_uris
,
client
,
job_config
=
None
)
Asynchronous job: extract data from a table into Cloud Storage.
job_id
str
the job's ID.
source
Union[ google.cloud.bigquery.table.TableReference
, google.cloud.bigquery.model.ModelReference
]
Table or Model from which data is to be loaded or extracted.
destination_uris
List[str]
URIs describing where the extracted data will be written in Cloud Storage, using the format gs://<bucket_name>/<object_name_or_glob>
.
client
job_config
Optional[ google.cloud.bigquery.job.ExtractJobConfig
]
Extra configuration options for the extract job.