Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion scripts/hydrate-raincloud-corpus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,11 @@ import raincloud

max_bytes = int(os.environ["MAX_MB"]) * 1024 * 1024
snapshot = json.loads(resources.files("raincloud").joinpath("_data/snapshot.json").read_text())
# `.get(key, 0)` returns 0 only when the key is absent; a snapshot entry can carry
# an explicit "parquet_bytes": null (not-yet-hashed slug), which .get returns as None.
# `or 0` coerces both the missing and the null case to 0 so the size cap still applies.
sizes = {
slug: entry.get("parquet_bytes", 0) + entry.get("vortex_bytes", 0)
slug: (entry.get("parquet_bytes") or 0) + (entry.get("vortex_bytes") or 0)
for slug, entry in snapshot["slugs"].items()
}

Expand Down
Loading