Skip to content

fix: render nested struct columns as JSON object cells in CSV export (#217)#222

Merged
dfa1 merged 2 commits into
mainfrom
fix/217-csv-struct
Jul 7, 2026
Merged

fix: render nested struct columns as JSON object cells in CSV export (#217)#222
dfa1 merged 2 commits into
mainfrom
fix/217-csv-struct

Conversation

@dfa1

@dfa1 dfa1 commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Fixes #217, the last gap split from #207: with nested struct columns now decodable, CSV export threw unsupported array type: StructArray.

Format decision: a struct cell renders as one JSON object {"field":value,...} with fields in declared order — numbers/booleans unquoted via the shared leaf rules (incl. the unsigned gating), strings JSON-escaped and double-quoted (minimal correct escaper: quote, backslash, short escapes, \uXXXX for control chars — no new dependency), nested structs recursed, and null fields as JSON null (inside JSON, bare CSV's empty-field null convention would be ambiguous). Only the JSON layer escapes; fastcsv independently quotes the cell. VortexWriter.arrayLength learns StructData so tests can write struct columns.

Validation: 14/14 CsvExporterTest (mixed-type struct, null struct field as JSON null, quote/comma escaping); countries-of-the-world exports all 262 rows with well-formed JSON cells and flips to ok in the matrix (its conformance run shows the documented oracle-abort skip — hardwood cannot read its nested parquet).

Also carries triage round 3 (second commit): 10 more datasets against a fully-fixed build — 8 pass exactly (categoricals at 48k rows, timestamps, wide numerics, text; a float32-vs-double artifact in the scratchpad compare script was verified bitwise-identical with numpy), 2 pinned as the new gap #221 (misaligned per-column chunk grids, two severity tiers documented in the issue). Matrix: 28 ok / 2 gaps (#221) / 217 untriaged; conformance suite 31/31 over all 30 hydrated slugs.

Closes #217

🤖 Generated with Claude Code

dfa1 and others added 2 commits July 7, 2026 06:52
…217)

A nested struct column (StructArray, decodable since #207) now renders
as one JSON object cell {"field":value,...} with fields in declared
order: numbers/booleans unquoted via the shared leaf rules, strings
JSON-escaped and quoted, nested structs recursed, and null fields as
JSON null (inside JSON the bare-CSV empty-field convention would be
ambiguous). Only the JSON layer escapes; fastcsv independently quotes
the cell. VortexWriter.arrayLength learns StructData so struct columns
can be written in tests.

Pinned by countries-of-the-world (Raincloud corpus, #205): its data
struct column blocked CSV export after the #207 scan fix.

Closes #217

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
8 ok (uci-car-evaluation, uci-air-quality, google-cluster-trace-2011,
uci-census-income, uci-bank-marketing, uci-sms-spam-collection,
uci-optical-recognition, uci-human-activity-recognition) plus 2 new
gaps pinned as gap:221 (misaligned per-column chunk grids:
uci-beijing-multi-site-air-quality, emotions-dataset-for-nlp).
countries-of-the-world flips to ok with the #217 fix (its conformance
run aborts on the documented hardwood-oracle nested-parquet limitation
rather than verifying, visible as a skip).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dfa1 dfa1 merged commit 1f7df95 into main Jul 7, 2026
6 checks passed
@dfa1 dfa1 deleted the fix/217-csv-struct branch July 7, 2026 04:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CSV export cannot render nested struct columns (StructArray)

1 participant