Skip to content

Commit 6e42a30

Browse files
dfa1claude
andcommitted
fix(ci): hydrate script crashes on snapshot entries with null byte sizes
The Raincloud conformance workflow failed on its first real run: the size-cap computation used entry.get('parquet_bytes', 0), but .get returns the default only for ABSENT keys — a snapshot entry with an explicit "parquet_bytes": null (a not-yet-hashed slug: jsonbench-bluesky-100m, wikipedia-structured-contents, code-contests, bi-commongovernment) returns None, and None + int raised TypeError, aborting the whole hydrate step. Coerce both fields with 'or 0' so missing and null both cap as 0. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent abf892b commit 6e42a30

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

scripts/hydrate-raincloud-corpus.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,11 @@ import raincloud
7777
7878
max_bytes = int(os.environ["MAX_MB"]) * 1024 * 1024
7979
snapshot = json.loads(resources.files("raincloud").joinpath("_data/snapshot.json").read_text())
80+
# `.get(key, 0)` returns 0 only when the key is absent; a snapshot entry can carry
81+
# an explicit "parquet_bytes": null (not-yet-hashed slug), which .get returns as None.
82+
# `or 0` coerces both the missing and the null case to 0 so the size cap still applies.
8083
sizes = {
81-
slug: entry.get("parquet_bytes", 0) + entry.get("vortex_bytes", 0)
84+
slug: (entry.get("parquet_bytes") or 0) + (entry.get("vortex_bytes") or 0)
8285
for slug, entry in snapshot["slugs"].items()
8386
}
8487

0 commit comments

Comments
 (0)