Class CopyJob (1.24.0)

CopyJob(job_id,sources,destination,client,job_config=None)

Asynchronous job: copy data into a table from other tables.

Parameters

NameDescription
job_idstr

the job's ID, within the project belonging toclient.

sourcesList[google.cloud.bigquery.table.TableReference]

Table from which data is to be loaded.

destinationgoogle.cloud.bigquery.table.TableReference

Table into which data is to be loaded.

clientgoogle.cloud.bigquery.client.Client

A client which holds credentials and project configuration for the dataset (which requires a project).

job_configgoogle.cloud.bigquery.job.CopyJobConfig

(Optional) Extra configuration options for the copy job.

Inheritance

builtins.object >google.api_core.future.base.Future >google.api_core.future.polling.PollingFuture >google.cloud.bigquery.job._AsyncJob >CopyJob

Methods

__init__

__init__(job_id,sources,destination,client,job_config=None)

Initialize self. See help(type(self)) for accurate signature.

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 helperthread to poll for the status of the operation in the background.

Parameter
NameDescription
fnCallable[Future]

The callback to execute when the operation is complete.

cancel

cancel(client=None,retry=<google.api_core.retry.Retryobject>,timeout=None)
Parameters
NameDescription
clientOptional[google.cloud.bigquery.client.Client]

the client to use. If not passed, falls back to theclient stored on the current dataset.

retryOptional[google.api_core.retry.Retry]

How to retry the RPC.

timeoutOptional[float]

The number of seconds to wait for the underlying HTTP transport before usingretry

Returns
TypeDescription
boolBoolean indicating that the cancel request was sent.

cancelled

cancelled()

Check if the job has been cancelled.

This always returns False. It's not possible to check if a job wascancelled in the API. This method is here to satisfy the interfaceforgoogle.api_core.future.Future.

Returns
TypeDescription
boolFalse

done

done(retry=<google.api_core.retry.Retryobject>,timeout=None)

Refresh the job and checks if it is complete.

Parameters
NameDescription
retrygoogle.api_core.retry.Retry

(Optional) How to retry the RPC.

timeoutOptional[float]

The number of seconds to wait for the underlying HTTP transport before usingretry.

Returns
TypeDescription
boolTrue if the job is complete, False otherwise.

exception

exception(timeout=None)

Get the exception from the operation, blocking if necessary.

Parameter
NameDescription
timeoutint

How long to wait for the operation to complete. If None, wait indefinitely.

Returns
TypeDescription
Optional[google.api_core.GoogleAPICallError]The operation's error.

exists

exists(client=None,retry=<google.api_core.retry.Retryobject>,timeout=None)

API call: test for the existence of the job via a GET request

Seehttps://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/get

Parameters
NameDescription
clientOptional[google.cloud.bigquery.client.Client]

the client to use. If not passed, falls back to theclient stored on the current dataset.

retrygoogle.api_core.retry.Retry

(Optional) How to retry the RPC.

timeoutOptional[float]

The number of seconds to wait for the underlying HTTP transport before usingretry.

Returns
TypeDescription
boolBoolean indicating existence of the job.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-01-09 UTC.