ods state build, then ods state retry --failed
Screenshots
--partial-parse-file-diff --indirect-selection eager --log-format json --log-level debug outcome failed totals 38ms · 2 built · 1 failed · 1 skipped rows at least 100 (2 nodes didn't report rows) stats reported as it ran journal .ods/state.db.runs/0cd61989-7484-46df-b1f0-e17ae713a653.jsonl recorded snapshot 2: 2 nodes advanced ┏━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━┳━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ node ┃ result ┃ took ┃ rows ┃ why it ran ┃ ┡━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━╇━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ │ customers │ success │ 250ms │ 100 │ code changed since run │ │ │ │ │ │ 25ae4c76-0acc-461b-941d-1dc68ff58bbc: │ │ │ │ │ │ sql │ │ customer_segments │ failed: KeyError: [value removed] │ 250ms │ — │ upstream code changed: customers will │ │ │ │ │ │ be rebuilt │ │ customers_snapshot_view │ success │ 250ms │ — │ upstream code changed: customers will │ │ │ │ │ │ be rebuilt │ │ segment_summary │ skipped │ — │ — │ upstream code changed: │ │ │ │ │ │ customer_segments will be rebuilt │ └─────────────────────────┴───────────────────────────────────┴───────┴──────┴─────────────────────────────────────────┘ Why it failed ╭─ customer_segments failed ───────────────────────────────────────────────────────────────────────────────────────────╮ │ what The Python model raised KeyError │ │ kind python model · python exception │ │ confidence known pattern │ │ │ │ why ODS thinks so │ │ ├── It failed after 250ms, during execution (compile succeeded). [run stats] │ │ └── Its code didn't change since its last successful build, in run 25ae4c76. [fingerprints] │ │ │ │ where models/marts/customer_segments.py compiled: target/compiled/jaffle_ods/models/marts/customer_segments.py │ │ impact blocks 1 downstream node (segment_summary was skipped). Its last good build is kept. │ │ │ │ what to try │ │ ├── 1. Read the traceback in the full log: it shows where in the model's code the exception was raised. │ │ └── 2. Then retry what failed: │ │ └── $ ods state retry --failed │ │ │ │ dbt said KeyError: [value removed] Literal values and SQL removed. │ │ full text dbt's log file (logs/dbt.log in the project, unless --log-path) │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ info: 2 nodes kept their last successful state and will be built next run error[ODS-E0404]: the run didn't fully succeed (2 nodes failed, were skipped or failed their tests; 0 checks failed) hint: nodes that built and passed their tests were recorded; the others keep their last successful state and are built (and tested) next run ❯
❯ ods state retry --failed -q fake dbt: source freshness fake dbt: compile 16:52:32 fake dbt: build 16:52:32 SUCCESS model.jaffle_ods.customer_segments 16:52:32 SUCCESS model.jaffle_ods.segment_summary 16:52:32 fake dbt: a warning after the nodes State run scope jaffle_ods/default compared with snapshot 2 in .ods/state.db plan 2 to build and test, 11 to reuse retrying what failed in ods state build: 2 retried, 0 reused, 0 held back dbt target_dir target (default) target dev (jaffle_ods, duckdb, fake-host, jaffle_ods) ran dbt build --select fqn:jaffle_ods.marts.customer_segments,resource_type:model fqn:jaffle_ods.marts.segment_summary,resource_type:model --target-path /tmp/ods-demo/jaffle_shop/target --write-json --partial-parse-file-diff --indirect-selection eager --log-format json --log-level debug outcome succeeded totals 19ms · 2 built rows — (not reported: 2 nodes didn't report rows) stats reported as it ran journal .ods/state.db.runs/c51c6445-81c6-4f59-a632-28ba8639f677.jsonl recorded snapshot 3: 2 nodes advanced ┏━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━┳━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ node ┃ result ┃ took ┃ rows ┃ why it ran ┃ ┡━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━╇━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ │ customer_segments │ success │ 250ms │ — │ new upstream data in customers │ │ segment_summary │ success │ 250ms │ — │ new upstream data in customer_segments │ └───────────────────┴─────────┴───────┴──────┴────────────────────────────────────────┘ ❯