Compare commits
1 Commits
v202602281
...
v12
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
85b6aa0d0a |
@@ -1,22 +1,19 @@
|
|||||||
"""Create minimal seed files for SQLMesh staging models that require landing data."""
|
"""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
|
import gzip
|
||||||
import json
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
seed = {
|
# stg_playtomic_availability requires at least one morning and one recheck file
|
||||||
"date": "1970-01-01",
|
morning = Path("data/landing/playtomic/1970/01/availability_1970-01-01.jsonl.gz")
|
||||||
"captured_at_utc": "1970-01-01T00:00:00Z",
|
recheck = Path("data/landing/playtomic/1970/01/availability_1970-01-01_recheck_00.jsonl.gz")
|
||||||
"venue_count": 0,
|
|
||||||
"venues_errored": 0,
|
|
||||||
"venues": [],
|
|
||||||
}
|
|
||||||
morning = Path("data/landing/playtomic/1970/01/availability_1970-01-01.json.gz")
|
|
||||||
recheck = Path("data/landing/playtomic/1970/01/availability_1970-01-01_recheck_00.json.gz")
|
|
||||||
morning.parent.mkdir(parents=True, exist_ok=True)
|
morning.parent.mkdir(parents=True, exist_ok=True)
|
||||||
for p in [morning, recheck]:
|
for p in [morning, recheck]:
|
||||||
if not p.exists():
|
if not p.exists():
|
||||||
with gzip.open(p, "wt") as f:
|
with gzip.open(p, "wb") as f:
|
||||||
json.dump(seed, f)
|
pass # empty JSONL — 0 rows, no error
|
||||||
print("created", p)
|
print("created", p)
|
||||||
else:
|
else:
|
||||||
print("exists ", p)
|
print("exists ", p)
|
||||||
|
|||||||
Reference in New Issue
Block a user