add accepts Infinity scores and writes records that immediately fail validation
Los mantenedores suelen responder en 2 días
@vivek-3728 ya está trabajando en esto.
Desde el 29/10/2026.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 76/100
Línea de trabajo
Empieza por localizar el análisis y la validación de score y max_score en el comando add; después, compara sus comprobaciones con las reglas numéricas del comando validate. Reproduce los comandos CLI proporcionados con un CSV temporal y revisa las pruebas pertinentes. El objetivo es que add rechace valores no finitos sin escribir un registro y que los registros aceptados superen validate.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 0
- Forks
- 5
- Merge medio
- 1 d 15 h
- PR fusionados (30 d)
- 27
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de techcsispit/grade-tracker
-
feat: add cross-file integrity verification and repairPosiblemente ocupada @deepmhatre13 la tomó hoy. Abiertofeature
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
techcsispit/grade-tracker#66 ·
Los mantenedores suelen responder en 2 días
-
Blank credits pass validation but cause valid grade records to disappearPosiblemente ocupada @vivek-3728 la tomó hace 9 días. Abiertobug good first issue
techcsispit/grade-tracker#53 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 2 días
Todos los issues de techcsispit/grade-tracker
Issues similares
-
changelog investigate
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
ramnes/notion-sdk-py#433 ·
-
docs pkg:core
Dificultad 1/5 Menos de una hora Aptitud para principiantes 84/100
pydantic/pydantic-ai#11929 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
intake/intake-esm#789 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
MemMachine/MemMachine#1877 ·
Los mantenedores suelen responder en 3 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
openedx/openedx-authz#579 ·
Los mantenedores suelen responder en 1 día