Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Blank credits pass validation but cause valid grade records to disappear

未关闭
#53 1 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 2 天内回复

@vivek-3728 已经在做这个了。

开始于 2026年10月20日。

评估

这个 Issue 还没有评估数据。

描述

bug good first issue

I noticed that the grade tracker accepts blank credits during validation but silently skips the same records when loading them for other commands.

For example, I created a CSV containing:

student_id,subject,score,max_score,date,credits,semester
S1,Mathematics,95,100,2026-10-06,,1

Then I ran:

python -m grade_tracker validate
python -m grade_tracker list
python -m grade_tracker summary S1

The results were inconsistent:

  • validate reported that the CSV was valid.
  • list showed no grades.
  • summary S1 reported no records for the student.
  • JSON output commands failed while converting the blank credits value.

I expected all commands to treat blank credits as the documented default of 3.0, so the Mathematics assessment would appear normally in listings, summaries, GPA calculations, and exports.

Looking through the code, the validator explicitly replaces blank credits with "3.0". However, the normal loader uses:

float(row.get("credits", 3.0))

Since the credits field exists but contains an empty string, dict.get() returns "" instead of the default. This causes float("") to fail, and the loader silently skips the record.

This means a CSV can pass validation while valid assessments disappear from calculations and reports without any warning.

I expected validation and all data-loading commands to apply the same default-credit rules consistently, rather than interpreting the same CSV differently.

主要语言
Python
星标
0
派生
5
平均合并
1 天 15 小时
30 天内合并 PR
27

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

techcsispit/grade-tracker 的其他 Issue

查看 techcsispit/grade-tracker 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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