AllenInstitute / AllenInstitute/ConnectsCommonConnectivity

Nested models (SpatialLocation) don't round-trip through the arrow layer

Open
#27 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug io
Dominant language
Jupyter Notebook
Stars
4
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Problem: the write path is pydantic → dicts → arrow → parquet. flatten_refs collapses a nested model to its id string — fine for references, but SpatialLocation has no id, so it survives as a raw dict while build_arrow_schema maps embedded-model fields to string. A dict then hits a string column: pyarrow errors, or stringifies into an unqueryable text blob. Model → parquet → model loses structure.

Fix options: (a) struct columns in arrow_utils; (b) explicit JSON-column convention; (c) don't nest — #25 flattens spatial and bypasses this. Keep this issue as the general record for any future nested model.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the arrow_utils entry points flatten_refs and build_arrow_schema, then trace the pydantic-to-dicts-to-arrow-to-parquet path described in the issue. Compare how nested models and reference models are represented at each step. Done means a SpatialLocation or other nested model can round-trip through parquet without becoming an invalid or unqueryable string.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-engineering, databases
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.