CopyJob(job_id, sources, destination, client, job_config=None)Asynchronous job: copy data into a table from other tables.
Parameters
| Name | Description |
| job_id |
str
the job's ID, within the project belonging to |
| sources |
List[google.cloud.bigquery.table.TableReference]
Table from which data is to be loaded. |
| destination |
google.cloud.bigquery.table.TableReference
Table into which data is to be loaded. |
| client |
google.cloud.bigquery.client.Client
A client which holds credentials and project configuration for the dataset (which requires a project). |
| job_config |
Optional[google.cloud.bigquery.job.CopyJobConfig]
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.base._AsyncJob > CopyJobProperties
create_disposition
See create_disposition.
created
Datetime at which the job was created.
| Type | Description |
| Optional[datetime.datetime] | the creation time (None until set from the server). |
destination
google.cloud.bigquery.table.TableReference: Table into which data is to be loaded.
destination_encryption_configuration
google.cloud.bigquery.encryption_configuration.EncryptionConfiguration: Custom encryption configuration for the destination table.
Custom encryption configuration (e.g., Cloud KMS keys) or :data:None
if using default encryption.
See destination_encryption_configuration.
ended
Datetime at which the job finished.
| Type | Description |
| Optional[datetime.datetime] | the end time (None until set from the server). |
error_result
Error information about the job as a whole.
| Type | Description |
| Optional[Mapping] | the error information (None until set from the server). |
errors
Information about individual errors generated by the job.
| Type | Description |
| Optional[List[Mapping]] | the error information (None until set from the server). |
etag
ETag for the job resource.
| Type | Description |
| Optional[str] | the ETag (None until set from the server). |
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.
| Name | Description |
| 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
| Name | Description |
| timeout |
Optional[float]
The number of seconds to wait for the underlying HTTP transport before using |
| client |
Optional[google.cloud.bigquery.client.Client]
the client to use. If not passed, falls back to the |
| retry |
Optional[google.api_core.retry.Retry]
How to retry the RPC. |
| Type | Description |
| bool | Boolean 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 was
cancelled in the API. This method is here to satisfy the interface
for google.api_core.future.Future.
| Type | Description |
| bool | False |
done
done(retry: retries.Retry = <google.api_core.retry.Retry object>, timeout: float = None, reload: bool = True)Checks if the job is complete.
| Name | Description |
| timeout |
Optional[float]
The number of seconds to wait for the underlying HTTP transport before using |
| reload |
Optional[bool]
If |
| retry |
Optional[google.api_core.retry.Retry]
How to retry the RPC. If the job state is |
| Type | Description |
| bool | True if the job is complete, False otherwise. |
exception
exception(timeout=None)Get the exception from the operation, blocking if necessary.
| Name | Description |
| timeout |
int
How long to wait for the operation to complete. If None, wait indefinitely. |
| Type | Description |
| Optional[google.api_core.GoogleAPICallError] | The operation's error. |
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
| Name | Description |
| timeout |
Optional[float]
The number of seconds to wait for the underlying HTTP transport before using |
| client |
Optional[google.cloud.bigquery.client.Client]
the client to use. If not passed, falls back to the |
| retry |
Optional[google.api_core.retry.Retry]
How to retry the RPC. |
| Type | Description |
| bool | Boolean indicating existence of the job. |