Skip to content

S3 — unfao/wire/shard.py: (target, month) frame slice + header → arrow shard bytes #108

Closed

Description

@Polichinel

Part of epic #105. Depends on S2. Parallel-eligible with S4/S5.

Problem

Hop B ships one views_frames.io.arrow file per (target, month) (§4.1) with the §2 header embedded; no writer exists.

Work

  • views_postprocessing/unfao/wire/shard.py: write_shard(values, time, unit, *, header, path) -> (name, sha256) calling views_frames.io.arrow.save(path, values=..., time=..., unit=..., level='pgm', metadata=header); name from wire.naming.shard_name; sha256 of the complete file bytes (§4.2 manifest needs it).
  • Small per-month slice helper in unfao/frame_extraction.py (frame → per-month (values, time, unit) primitives) so the writer stays frame-API-free.

Acceptance criteria

  • Fed the fixture Track-A frame + S2 header: produced bytes byte-equal fixture_run_0__lr_ged_sb__m000543.arrow.parquet; returned sha256 matches SHA256SUMS.
  • Byte test asserts pyarrow 23.0.1 (fixture README pin) and fails loud with a 'pinned toolchain' message on mismatch — never skip-silent.

Tests: tests/test_wire_shard.py. Oracle: fixture arrow shard.

🤖 Generated with Claude Code

Activity

  1. added
    story
    implementation
    on Jul 19, 2026
  2. added a commit that references this issue on Jul 20, 2026
  3. Polichinel commented on Jul 31, 2026

    @Polichinel
    CollaboratorAuthor

    Shipped and proven by run-0. unfao/wire/shard.py (35 lines) exists on development, is covered by the wire test suite including byte-parity against the ADR-013 §10 golden fixture, and produced all 108 shards (3 targets × 36 months) in the first FAO global-land delivery on 2026-07-27. Live API confirmed serving them 2026-07-31 (smoke test ALL PASS). Closed during the development→main cleanup sweep; reopen if anything here is unfinished.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    implementationstory

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions