Skip to content

Commit

Permalink
Move dataset cleanup to finishBundle (#31955)
Browse files Browse the repository at this point in the history
  • Loading branch information
Abacn authored Jul 23, 2024
1 parent 2294779 commit aa3cfe5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sdks/python/apache_beam/io/gcp/bigquery_read_internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def _get_temp_dataset_id(self):
else:
raise ValueError("temp_dataset has to be either str or DatasetReference")

def setup(self):
def start_bundle(self):
self.bq = bigquery_tools.BigQueryWrapper(
temp_dataset_id=self._get_temp_dataset_id(),
client=bigquery_tools.BigQueryWrapper._bigquery_client(self.options))
Expand Down Expand Up @@ -267,7 +267,7 @@ def process(self,
table_reference.datasetId,
table_reference.tableId)

def teardown(self):
def finish_bundle(self):
if self.bq.created_temp_dataset:
self.bq.clean_up_temporary_dataset(self._get_project())

Expand Down

0 comments on commit aa3cfe5

Please sign in to comment.