This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new d4eb60712d Use project_id to get authenticated client (#25984)
d4eb60712d is described below

commit d4eb60712dc7bb34960ae10b9e6dd8624a554dfc
Author: Phani Kumar <[email protected]>
AuthorDate: Sat Aug 27 07:42:29 2022 +0530

    Use project_id to get authenticated client (#25984)
---
 airflow/providers/google/cloud/hooks/bigquery.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/airflow/providers/google/cloud/hooks/bigquery.py 
b/airflow/providers/google/cloud/hooks/bigquery.py
index 731cd6364b..6776942fc5 100644
--- a/airflow/providers/google/cloud/hooks/bigquery.py
+++ b/airflow/providers/google/cloud/hooks/bigquery.py
@@ -448,12 +448,13 @@ class BigQueryHook(GoogleBaseHook, DbApiHook):
             dataset_reference["datasetReference"][param] = value
 
         location = location or self.location
+        project_id = project_id or self.project_id
         if location:
             dataset_reference["location"] = dataset_reference.get("location", 
location)
 
         dataset: Dataset = Dataset.from_api_repr(dataset_reference)
         self.log.info('Creating dataset: %s in project: %s ', 
dataset.dataset_id, dataset.project)
-        dataset_object = self.get_client(location=location).create_dataset(
+        dataset_object = self.get_client(project_id=project_id, 
location=location).create_dataset(
             dataset=dataset, exists_ok=exists_ok
         )
         self.log.info('Dataset created successfully.')

Reply via email to