From d615f82909b42df139ce755cb3f45d487a8aa4c4 Mon Sep 17 00:00:00 2001 From: Tim Sawicki <136370015+tim-quix@users.noreply.github.com> Date: Tue, 17 Dec 2024 07:56:39 -0500 Subject: [PATCH] fix bug around dataset and table ids (#691) --- quixstreams/sinks/community/bigquery.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/quixstreams/sinks/community/bigquery.py b/quixstreams/sinks/community/bigquery.py index 501334ec2..3dd3b231f 100644 --- a/quixstreams/sinks/community/bigquery.py +++ b/quixstreams/sinks/community/bigquery.py @@ -106,12 +106,9 @@ def __init__( super().__init__() self.location = location - self.table_name = table_name - self.project_id = project_id - - self.dataset_id = dataset_id - self.table_id = f"{self.dataset_id}.{self.table_name}" + self.dataset_id = f"{self.project_id}.{dataset_id}" + self.table_id = f"{self.dataset_id}.{table_name}" self.ddl_timeout = ddl_timeout self.insert_timeout = insert_timeout self.retry = bigquery.DEFAULT_RETRY.with_timeout(timeout=retry_timeout) @@ -128,6 +125,7 @@ def __init__( kwargs["credentials"] = credentials self._client = bigquery.Client(**kwargs) + logger.info("Successfully authenticated to BigQuery.") if self.schema_auto_update: # Initialize a table in BigQuery if it doesn't exist already self._init_table()