Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đã đóng
#1,247 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
75/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
c
Lĩnh vực
data-engineering

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
C
Star
3
Fork
7
Merge trung bình
4 giờ 15 phút
Pull request đã merge (30 ngày)
106

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của InauguralSystems/EigenScript

Tất cả issue của InauguralSystems/EigenScript

Issue tương tự

Thêm issue về C

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.