AOSSIE-Org / AOSSIE-Org/PictoPy

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

Đang mở
#1,317 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
possible-duplicate
Ngôn ngữ chính
Python
Star
283
Fork
679
Merge trung bình
7 ngày 2 giờ
Pull request đã merge (30 ngày)
3

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.