Files
padelnomics/web/scripts/init_landing_seeds.py
Deeman 85b6aa0d0a
All checks were successful
CI / test (push) Successful in 48s
CI / tag (push) Successful in 2s
fix(seeds): update init_landing_seeds.py to write JSONL format
Old script wrote blob json.gz seeds; staging models now only read jsonl.gz.
Seeds are empty JSONL gzip files — zero rows, satisfies DuckDB file-not-found check.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-28 18:50:51 +01:00

20 lines
772 B
Python

"""Create minimal seed files for SQLMesh staging models that require landing data.
Seeds are empty JSONL gzip files — they satisfy DuckDB's file-not-found check
while contributing zero rows to the staging models.
"""
import gzip
from pathlib import Path
# stg_playtomic_availability requires at least one morning and one recheck file
morning = Path("data/landing/playtomic/1970/01/availability_1970-01-01.jsonl.gz")
recheck = Path("data/landing/playtomic/1970/01/availability_1970-01-01_recheck_00.jsonl.gz")
morning.parent.mkdir(parents=True, exist_ok=True)
for p in [morning, recheck]:
if not p.exists():
with gzip.open(p, "wb") as f:
pass # empty JSONL — 0 rows, no error
print("created", p)
else:
print("exists ", p)