add accepts Infinity scores and writes records that immediately fail validation
Maintainer thường phản hồi trong vòng 2 ngày
@vivek-3728 đang làm issue này rồi.
Từ ngày 29/10/2026.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 76/100
Hướng nghiên cứu
Bắt đầu bằng cách tìm phần phân tích cú pháp và xác thực score, max_score của lệnh add, sau đó so sánh các bước kiểm tra với quy tắc số của lệnh validate. Chạy lại các lệnh CLI được cung cấp với một tệp CSV tạm thời và xem các bài kiểm thử liên quan. Hoàn thành khi add từ chối các giá trị không hữu hạn mà không ghi bản ghi, và các bản ghi được chấp nhận vượt qua validate.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
I found a bug where the add command accepts inf as both the score and maximum score, even though these are not valid numeric grades.
The command reports success and writes the record to the CSV, but running validate immediately afterward rejects the same record.
This means a normal add operation can turn an otherwise valid grade file into one that fails the application's own validation.
Steps to Reproduce
Run:
python -m grade_tracker --data grades.csv add S1 Math inf inf 2026-10-30 3 1
python -m grade_tracker --data grades.csv validate
Actual Behavior
The add command reports:
Added grade for S1 in Math.
The CSV now contains:
S1,Math,inf,inf,2026-10-30,3.0,1
However, validation reports:
Error: row 2, field score: 'inf' is not a numeric score
Error: row 2, field max_score: 'inf' is not a numeric maximum score
Validation failed: 2 problems found.
Expected Behavior
The add command should reject non-finite values before writing anything to the CSV.
Any record successfully added through the CLI should also pass the application's numeric validation rules.
Likely Cause
The add command relies on numeric range comparisons without explicitly checking whether the values are finite.
Since Python evaluates float("inf") <= float("inf") as True, the invalid values pass the existing checks.
The validation command applies stricter numeric rules and correctly rejects them.
Using math.isfinite() for both score and max_score would prevent Infinity and NaN values from being accepted.
Impact
A successful CLI operation can introduce invalid grade records into an otherwise valid CSV file.
This creates inconsistent behavior between add and validate and may affect subsequent calculations, reporting, or exports.
The issue was reproduced on the latest upstream/main and no matching report was found among the 68 open and closed issues and PRs checked.
- Ngôn ngữ chính
- Python
- Star
- 0
- Fork
- 5
- Merge trung bình
- 1 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 27
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của techcsispit/grade-tracker
-
feat: add cross-file integrity verification and repairCó thể đã có người làm @deepmhatre13 đã nhận hôm nay. Đang mởfeature
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
techcsispit/grade-tracker#66 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Blank credits pass validation but cause valid grade records to disappearCó thể đã có người làm @vivek-3728 đã nhận 9 ngày trước. Đang mởbug good first issue
techcsispit/grade-tracker#53 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của techcsispit/grade-tracker
Issue tương tự
-
Support .aac audio uploadsCó thể đã có người làm @julien731 đã nhận hôm nay. Đang mởfeature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
nimblehq/audio-transcriber#153 ·
-
help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
antonyrag/ragleap-core#1062 ·
-
needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
gke-labs/kube-agents#4321 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Git-Hospital/githealthcheck#61 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
changelog investigate
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
ramnes/notion-sdk-py#433 ·