Skip to content

Commit

Permalink
Fix db insert error
Browse files Browse the repository at this point in the history
  • Loading branch information
antonyharfield committed Nov 15, 2024
1 parent 732e1d7 commit ca6678e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions rfm/legacy/classify.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,11 @@ def insert_result_to_db(db, job_id, rec_id, species, songtype, presence, max_v):
INSERT INTO `classification_results` (
job_id, recording_id, species_id, songtype_id, present,
max_vector_value
) VALUES (%s, %s, %s, %s, %s,
%s
)
""", [job_id, rec_id, species, songtype, presence, max_v])
) VALUES (%s, %s, %s, %s, %s, %s)
""", [job_id, rec_id, species, songtype, presence, float(max_v)])
db.commit()
except Exception:
print('ERROR writing {}'.format(traceback.format_exc()))
insert_rec_error(db, rec_id, job_id)

def process_results(res, working_folder, model_uri, job_id, species, songtype, db, log):
Expand Down

0 comments on commit ca6678e

Please sign in to comment.