data.df_from_csv silently replaces text and empty cells with numeric zero
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 75/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- c
- Domain
- data-engineering
Research direction
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.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- C
- Stars
- 3
- Forks
- 7
- Avg merge
- 3h 56m
- Merged PRs (30d)
- 102
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from InauguralSystems/EigenScript
-
area:lint-tooling bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
InauguralSystems/EigenScript#1340 ·
Maintainers usually reply within 1 day
-
area:stdlib found-by:code-review kind:silent-wrong
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
InauguralSystems/EigenScript#1338 ·
Maintainers usually reply within 1 day
-
area:lint-tooling found-by:critic kind:docs-drift
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
InauguralSystems/EigenScript#1335 ·
Maintainers usually reply within 1 day
-
area:ci found-by:critic kind:gate-defect
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
InauguralSystems/EigenScript#1311 ·
Maintainers usually reply within 1 day
-
enrolment: decide test_gc_runner_controls.py (exempt vs enrol) and whether floors need a ratchetOpenarea:gates found-by:critic kind:decision
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
InauguralSystems/EigenScript#1280 · 1 comment ·
Maintainers usually reply within 1 day
All issues in InauguralSystems/EigenScript
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
libretro/libretro-common#233 ·
-
[Bug]: chunk_span_bounds and _validated_chunk_spans reject Pydantic models ChunkSpan and AudioFileOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
BasedHardware/omi#19047 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
obsproject/obs-studio#13936 · 2 comments ·
Maintainers usually reply within 1 day