AOSSIE-Org / AOSSIE-Org/PictoPy

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

オープン
#1,317 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
possible-duplicate
主要言語
Python
スター
283
フォーク
679
平均マージ
7日 2時間
マージ済み PR(30日)
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 を短くまとめたダイジェスト。