Skip to content

Job files (tet run) ​

Ordered stock tet steps in TOML or JSON. Run them with tet run or tet.run_job — same Rust engine, fail-fast.

Not a scheduler (no DAG, conditionals, loops, retries). Not query-pipeline ETL — chained transforms belong on the query pipeline wire.

Prefer a verify step before query on external bytes — Trust boundaries.

CLI flags and the closed op set: tet run.

Worked example ​

toml
schema_version = 1

[[step]]
op = "convert"
from = "raw/table.csv"
to = "work/table.tet"

[[step]]
op = "verify"
path = "work/table.tet"

[[step]]
op = "query"
tet = "work/table.tet"
execute = true
query = { dataset = "a", mean = [] }
bash
mkdir -p raw work
printf 'a,b\n1,2\n3,4\n' > raw/table.csv
tet run job.toml
tet run job.toml --json 2>/dev/null | jq '.steps[] | {op, data}'

Crate fixture: fixtures/jobs/csv_verify_query.toml.

Reading the report ​

Both tet run --json (stdout) and tet.run_job return the same JobReport shape:

KeyMeaning
dry_runtrue if nothing was executed
rootDirectory used for relative paths
elapsed_secsWall clock (success); sum of finished steps on a CLI partial failure
stepsOne entry per completed (or planned) step

Each step:

KeyMeaning
index0-based
ope.g. "convert"
status"ok" or "planned" (--dry-run / dry_run=True)
descriptionOne-line plan with resolved paths
elapsed_secsThat step only
stdout / noteHuman text the CLI would print — optional
dataStructured result — use this, not stdout

Under dry-run, every data is null. On success there is no top-level ok / error key — absence of an exception (Python) or exit 0 (CLI) means the job finished.

Python ​

python
import tet

report = tet.run_job("job.toml")
print(report["root"], report["elapsed_secs"])

# Index into steps
convert = report["steps"][0]["data"]
print(convert["dataset_count"], convert["dataset_names"])   # 2, ["a", "b"]
print(convert["output"])                                    # …/work/table.tet

verify = report["steps"][1]["data"]
assert verify["ok"] is True

query = report["steps"][2]["data"]
# QueryResponse — same shape as f.execute(..., raw=True)
print(query["status"], query.get("operation"))

# Or key by op (last wins if an op repeats)
by_op = {s["op"]: s["data"] for s in report["steps"]}
by_op["verify"]["summary"]["dataset_count"]

plan = tet.run_job("job.toml", dry_run=True)
assert all(s["data"] is None for s in plan["steps"])

root= matches CLI --root. Failures raise TetError (same messages as tet run) — no partial error object in the return value.

CLI (--json) ​

bash
tet run job.toml --json 2>/dev/null | jq '
  .steps[] | select(.op=="convert") | .data.dataset_names
'

Mid-job failure (exit 1): stdout may still hold completed steps plus "error": { "index", "op", "message", "path" } (index is 0-based). First-step / parse failures print nothing on stdout — check the exit code.

What lives in data ​

Type name by op (field details stay in the crate):

opdata
infotet info --json envelope
verifyTetVerifyReport
repairRepairPlan or TetRepairReport
queryQueryResponse
convert / exportConvertReport / ExportReport
indexsmall { ok, path, … }
semantics.applySemanticsApplyReport
semantics.scaffold / set / package-writesmall { ok, path, … }
semantics.wizardWizardResult
semantics.lintSemanticsLintReport
ingest{ package, jobs, parts }
publish / compact{ mode, … } (published / dry_run / aborted)
packsmall { ok, package, … }
gc{ target, apply, plan|report }

Field-level schemas: crate docs/job.md — Machine-readable output.