AOSSIE-Org / AOSSIE-Org/PictoPy

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

未关闭
#1,317 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
possible-duplicate
主要语言
Python
星标
283
派生
679
平均合并
7 天 2 小时
30 天内合并 PR
3

描述

**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!

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。