@@ -185,40 +185,16 @@ def ignore(self, table_name, key, message=""):
185185
186186 return True
187187
188- def complete (self , table_name , key , run_duration = None , run_metadata = None ):
188+ def complete (self , table_name , key ):
189189 """
190190 Log a completed job. When a job is completed, its reservation entry is deleted.
191191
192192 Args:
193193 table_name: `database`.`table_name`
194194 key: the dict of the job's primary key
195- run_duration: duration in second of the job run
196- run_metadata: dict containing metadata about the run (e.g. code version, environment info)
197195 """
198196 job_key = dict (table_name = table_name , key_hash = key_hash (key ))
199- if self & job_key :
200- current_status = (self & job_key ).fetch1 ("status" )
201- if current_status == "success" :
202- return
203-
204- with config (enable_python_native_blobs = True ):
205- self .insert1 (
206- dict (
207- table_name = table_name ,
208- key_hash = key_hash (key ),
209- status = "success" ,
210- host = platform .node (),
211- pid = os .getpid (),
212- connection_id = self .connection .connection_id ,
213- user = self ._user ,
214- key = _jsonify (key ),
215- run_duration = run_duration ,
216- run_metadata = _jsonify (run_metadata ) if run_metadata else None ,
217- timestamp = datetime .datetime .utcnow (),
218- ),
219- replace = True ,
220- ignore_extra_fields = True ,
221- )
197+ (self & job_key ).delete ()
222198
223199 def error (self , table_name , key , error_message , error_stack = None , run_duration = None , run_metadata = None ):
224200 """
0 commit comments