Skip to content

Commit

Permalink
Add BQ Job labels to copy_bq_table
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-Krykun committed Jan 30, 2025
1 parent a219818 commit 83d55b0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dbt/adapters/bigquery/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ def copy_bq_table(self, source, destination, write_disposition) -> None:
destination_ref = self.table_ref(
destination.database, destination.schema, destination.table
)
labels = self.get_labels_from_query_comment()

logger.debug(
'Copying table(s) "{}" to "{}" with disposition: "{}"',
Expand All @@ -440,7 +441,7 @@ def copy_bq_table(self, source, destination, write_disposition) -> None:
copy_job = client.copy_table(
source_ref_array,
destination_ref,
job_config=CopyJobConfig(write_disposition=write_disposition),
job_config=CopyJobConfig(write_disposition=write_disposition, labels=labels),
retry=self._retry.create_reopen_with_deadline(conn),
)
copy_job.result(timeout=self._retry.create_job_execution_timeout(fallback=300))
Expand Down

0 comments on commit 83d55b0

Please sign in to comment.