File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change 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
3535class 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 ):
You can’t perform that action at this time.
0 commit comments