Skip to content

Commit d4eb607

Browse files
authored
Use project_id to get authenticated client (#25984)
1 parent b75797e commit d4eb607

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

airflow/providers/google/cloud/hooks/bigquery.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,12 +448,13 @@ def create_empty_dataset(
448448
dataset_reference["datasetReference"][param] = value
449449

450450
location = location or self.location
451+
project_id = project_id or self.project_id
451452
if location:
452453
dataset_reference["location"] = dataset_reference.get("location", location)
453454

454455
dataset: Dataset = Dataset.from_api_repr(dataset_reference)
455456
self.log.info('Creating dataset: %s in project: %s ', dataset.dataset_id, dataset.project)
456-
dataset_object = self.get_client(location=location).create_dataset(
457+
dataset_object = self.get_client(project_id=project_id, location=location).create_dataset(
457458
dataset=dataset, exists_ok=exists_ok
458459
)
459460
self.log.info('Dataset created successfully.')

0 commit comments

Comments
 (0)