AOSSIE-Org / AOSSIE-Org/PictoPy

fix: remove leftover debugging code and improve error handling in yolo_mapping.py

Ouverte
#1,317 3 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
possible-duplicate
Langage dominant
Python
Étoiles
283
Forks
679
Merge moyen
7 j 2 h
PR mergées (30 j)
3

Description

**Describe the bug or improvement**
The database module `backend/app/database/yolo_mapping.py` contains leftover debugging code (`import os` and `print(os.getcwd())`) that clutters the console output every time the YOLO classes table is created.

Additionally, the database execution block lacks proper `except sqlite3.Error` handling and logging, which is inconsistent with the rest of the database modules.

**Proposed Solution**
1. Remove the leftover `import os` and `print(os.getcwd())` from `db_create_YOLO_classes_table`.
2. Wrap the `cursor.execute` calls in an `except sqlite3.Error` block to catch and log database failures properly using the project's standard logger (`logger.error()`), matching the recent cleanup done in `faces.py`, `metadata.py`, etc.

This is a good first issue for anyone looking to contribute!

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.