Skip to content

Commit

Permalink
Use project_id to get authenticated client (#25984)
Browse files Browse the repository at this point in the history
  • Loading branch information
phanikumv authored Aug 27, 2022
1 parent b75797e commit d4eb607
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion airflow/providers/google/cloud/hooks/bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,12 +448,13 @@ def create_empty_dataset(
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.')
Expand Down

0 comments on commit d4eb607

Please sign in to comment.