Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

data.df_from_csv silently replaces text and empty cells with numeric zero

Cerrado
#1,247 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
75/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
c

Línea de trabajo

Read lib/data.eigs lines 40–45 and the num contract in docs/SPEC.md, then run the provided CSV reproduction. Add regression coverage in tests/test_data.eigs for text, empty cells, and numeric values, and review docs/STDLIB.md for the inference policy. Done means text and empty cells retain their values and types while valid numbers remain numeric.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

area:stdlib bug found-by:code-review kind:silent-wrong

data.df_from_csv silently converts text fields such as names and empty strings into numeric zero. A normal mixed text/numeric CSV loses its names and other textual data on import.

Reproduce

Run from the repository root:

probe_dir=$(mktemp -d)
printf 'name,age,note\nAlice,30,\nBob,0,x12\n' > "$probe_dir/input.csv"
src/eigenscript -e 'import data
argv is args of null
print of (json_encode of (data.df_from_csv of argv[0]))' "$probe_dir/input.csv"

Actual (exit 0):

[{"name":0,"age":30,"note":0},{"name":0,"age":0,"note":0}]

Expected: Alice, Bob, the empty note, and x12 remain strings; 30 and 0 are numeric. This fixture needs no CSV quoting or dialect decisions.

Cause and coverage

lib/data.eigs:40–45 attempts numeric conversion and then checks whether the result has type num. The num contract explicitly converts strings without a leading number to numeric 0, so that check cannot distinguish successful numeric parsing from text. The branch that preserves the original string is unreachable for string cells.

df_from_csv is documented as the typed-column CSV reader. Existing tests/test_data.eigs constructs dataframes with df_from_rows and does not exercise CSV import/export.

A regression should assert both values and types for alphabetic text, empty cells, and valid zero and nonzero numbers. Preserve text rather than using a failed numeric conversion as zero. Decide and document the inference policy for ambiguous numeric-prefix strings such as 12abc; this report does not claim the existing documentation already specifies that case.

Confirmed with a fresh default release build of b91768e23c5a874a64e76e4af9ab291e6aa49983, with inherited EIGS_* variables removed.

Lenguaje dominante
C
Estrellas
3
Forks
7
Merge medio
3 h 58 min
PR fusionados (30 d)
105

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de InauguralSystems/EigenScript

Todos los issues de InauguralSystems/EigenScript

Issues similares

Más issues de C

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.