feat(esm_catalog): PR-A3 — shard federation (merge_shards)#1488
Open
siligam wants to merge 1 commit into
Open
Conversation
siligam
force-pushed
the
esm-catalog/pr-a2-duckdb-shard
branch
from
June 17, 2026 12:12
25af643 to
55decf4
Compare
siligam
force-pushed
the
esm-catalog/pr-a3-federation
branch
from
June 17, 2026 12:12
97c7c22 to
ca2ed54
Compare
siligam
force-pushed
the
esm-catalog/pr-a2-duckdb-shard
branch
from
June 17, 2026 15:57
55decf4 to
f1469e5
Compare
siligam
force-pushed
the
esm-catalog/pr-a3-federation
branch
from
June 17, 2026 15:57
ca2ed54 to
e9dde21
Compare
- Add storage/federation.py: merge_shards(shard_paths, output_path) uses DuckDB ATTACH to upsert collections, items, and collection_item_props from any number of per-experiment shards into a single global catalog. Safe to re-run (INSERT OR REPLACE / INSERT OR IGNORE); missing shard paths are skipped with a warning. - Add 'esm-catalog merge' CLI: wraps merge_shards() for the command line. - 7 new tests: two-shard merge, idempotency, incremental merge into non-empty global, missing-shard tolerance, props indexed, CLI end-to-end. This is Miguel's "sync shard to global DB" unit. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
siligam
force-pushed
the
esm-catalog/pr-a2-duckdb-shard
branch
from
June 17, 2026 16:34
f1469e5 to
e748bf2
Compare
siligam
force-pushed
the
esm-catalog/pr-a3-federation
branch
from
June 17, 2026 16:34
e9dde21 to
fd065b9
Compare
Contributor
Author
|
Rebased onto the corrected PR-0 base (#1483) — test relocation to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
storage/federation.py:merge_shards(shard_paths, output_path)— uses DuckDBATTACHto copycollections,items, andcollection_item_propsrows from any number of per-experiment.duckdbshards into a single global catalog file. Rows are upserted (INSERT OR REPLACE / INSERT OR IGNORE) so the command is safe to re-run as shards are refreshed. Missing paths are skipped with a warning.esm-catalog merge <shard>... --output <global.duckdb>CLI subcommand.This is Miguel's third unit — "sync shard to global DB". Together with A1b-1/A1b-2 (scan) and A2 (shard), the full ingest pipeline is now:
Test plan
pytest src/esm_catalog/tests/test_federation.py -v— 7 tests pass locallypytest src/esm_catalog/tests— 62 tests, 0 failures🤖 Generated with Claude Code