Skip to content

Commit 8270a10

Browse files
authored
feat: expose configuration property on CopyJob, ExtractJob, LoadJob, QueryJob (#1521)
* feat: expose configuration property on CopyJob, ExtractJob, LoadJob, QueryJob Note for google-cloud-bigquery developers: This also refactors these classes so that `_set_properties` does not modify the `_properties` dictionary in-place. Doing so was also mutating the request object, making it difficult to debug what request was _actually_ sent. Before this change, many tests hallucinated that the request was always equal to the response. * E google.api_core.exceptions.BadRequest: 400 Clone operation with write disposition WRITE_TRUNCATE is not supported. Please try again with WRITE_EMPTY.
1 parent 2d46d3e commit 8270a10

File tree

10 files changed

+333
-289
lines changed

10 files changed

+333
-289
lines changed

google/cloud/bigquery/client.py

+1-8
Original file line numberDiff line numberDiff line change
@@ -1976,15 +1976,8 @@ def create_job(
19761976
)
19771977
destination = _get_sub_prop(job_config, ["copy", "destinationTable"])
19781978
destination = TableReference.from_api_repr(destination)
1979-
sources = []
1980-
source_configs = _get_sub_prop(job_config, ["copy", "sourceTables"])
1981-
if source_configs is None:
1982-
source_configs = [_get_sub_prop(job_config, ["copy", "sourceTable"])]
1983-
for source_config in source_configs:
1984-
table_ref = TableReference.from_api_repr(source_config)
1985-
sources.append(table_ref)
19861979
return self.copy_table(
1987-
sources,
1980+
[], # Source table(s) already in job_config resource.
19881981
destination,
19891982
job_config=typing.cast(CopyJobConfig, copy_job_config),
19901983
retry=retry,

0 commit comments

Comments
 (0)