Skip to content

Commit

Permalink
feat: add date suffix in addition to UUID suffix (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
maamoonhussain authored Jan 20, 2024
1 parent 2d59eae commit f96c550
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions target_bigquery/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,8 @@ def __init__(
and self._is_upsert_candidate()
):
self.merge_target = copy(self.table)
self.table = BigQueryTable(name=f"{self.table_name}__{uuid.uuid4()}", **opts)
self.table = BigQueryTable(
name=f"{self.table_name}__{time.strftime('%Y%m%d%H%M%S')}__{uuid.uuid4()}", **opts)
self.table.create_table(
self.client,
self.apply_transforms,
Expand All @@ -334,7 +335,8 @@ def __init__(
time.sleep(2.5) # Wait for eventual consistency
elif self._is_overwrite_candidate():
self.overwrite_target = copy(self.table)
self.table = BigQueryTable(name=f"{self.table_name}__{uuid.uuid4()}", **opts)
self.table = BigQueryTable(
name=f"{self.table_name}__{time.strftime('%Y%m%d%H%M%S')}__{uuid.uuid4()}", **opts)
self.table.create_table(
self.client,
self.apply_transforms,
Expand Down

0 comments on commit f96c550

Please sign in to comment.