Skip to content

Commit

Permalink
precommit
Browse files Browse the repository at this point in the history
  • Loading branch information
dlwh committed Jan 7, 2025
1 parent ec7b041 commit 605e743
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
11 changes: 0 additions & 11 deletions scripts/gcs_bulk_delete.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import re
import sys
import time
from datetime import datetime

import google.auth
from google.api_core import operations_v1
from google.cloud import storage_transfer_v1
from google.type.date_pb2 import Date
from google.type.timeofday_pb2 import TimeOfDay


EMPTY_BUCKET = "levanter-empty"
Expand All @@ -33,14 +30,6 @@ def schedule_gcs_deletion_job(project_id, gcs_bucket_name, path_to_delete):
gcs_data_source=storage_transfer_v1.types.GcsData(bucket_name=EMPTY_BUCKET),
transfer_options=storage_transfer_v1.types.TransferOptions(delete_objects_unique_in_sink=True),
),
# schedule=storage_transfer_v1.types.Schedule(
# schedule_start_date=Date(
# year=datetime.utcnow().year, month=datetime.utcnow().month, day=datetime.utcnow().day
# ),
# start_time_of_day=TimeOfDay(
# hours=datetime.utcnow().hour, minutes=datetime.utcnow().minute + 2 # Start in 2 minutes
# ),
# ),
status=storage_transfer_v1.types.TransferJob.Status.ENABLED,
description=f"Delete all files in {gcs_bucket_name}/{path_to_delete}",
)
Expand Down
6 changes: 5 additions & 1 deletion src/levanter/utils/background_iterable.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ def __iter__(self):


class BackgroundIterator(Iterator[Ex]):
def __init__(self, producer_fn: Callable[[], Iterator[Ex]|AsyncIterator[Ex]]| Iterator[Ex] | AsyncIterator[Ex], max_capacity: Optional[int]):
def __init__(
self,
producer_fn: Callable[[], Iterator[Ex] | AsyncIterator[Ex]] | Iterator[Ex] | AsyncIterator[Ex],
max_capacity: Optional[int],
):
self.max_capacity = max_capacity
if not callable(producer_fn):
self._producer_fn = lambda: producer_fn
Expand Down

0 comments on commit 605e743

Please sign in to comment.