Skip to content

Commit 6d487f3

Browse files
committed
fix
1 parent ead839e commit 6d487f3

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

bigframes/session/anonymous_dataset.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
_TEMP_TABLE_ID_FORMAT = "bqdf{date}_{session_id}_{random_id}"
3030
# UDFs older than this many days are considered stale and will be deleted
3131
# from the anonymous dataset before creating a new UDF.
32-
_UDF_CLEANUP_THRESHOLD_DAYS = 30
32+
_UDF_CLEANUP_THRESHOLD_DAYS = 3
3333

3434

3535
class AnonymousDatasetManager(temporary_storage.TemporaryStorageManager):
@@ -151,15 +151,13 @@ def _cleanup_old_udfs(self):
151151
) - datetime.timedelta(days=_UDF_CLEANUP_THRESHOLD_DAYS)
152152

153153
for routine in routines:
154-
print("Routine: ", routine.routine_id, routine.created)
155154
if (
156155
routine.created < cleanup_cutoff_time
157156
and routine._properties["routineType"] == "SCALAR_FUNCTION"
158157
):
159158
try:
160-
self.bqclient.delete_routine(routine.reference)
161-
print(">>>> This routine gets deleted!")
162-
except Exception:
159+
self.bqclient.delete_routine(routine.reference, not_found_ok=True)
160+
except Exception as e:
163161
pass
164162

165163
def close(self):

0 commit comments

Comments
 (0)