[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-dbt-labs-ade-bench-cross-db-tasks":3,"mdc-pqkv1l-key":34,"related-repo-dbt-labs-ade-bench-cross-db-tasks":1661,"related-org-dbt-labs-ade-bench-cross-db-tasks":1670},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":24,"repoUrl":25,"updatedAt":26,"license":27,"forks":28,"topics":29,"repo":30,"sourceUrl":32,"mdContent":33},"ade-bench-cross-db-tasks","author ade-bench database tasks","Use when authoring or debugging ade-bench tasks that must run on both DuckDB and Snowflake, including shared project migrations, setup patches, and solution patches",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"dbt-labs","dbt Labs","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fdbt-labs.png",[12,16,18,21],{"name":13,"slug":14,"type":15},"Database","database","tag",{"name":17,"slug":17,"type":15},"dbt",{"name":19,"slug":20,"type":15},"SQL","sql",{"name":22,"slug":23,"type":15},"Testing","testing",109,"https:\u002F\u002Fgithub.com\u002Fdbt-labs\u002Fade-bench","2026-04-13T05:26:41.405997",null,22,[],{"repoUrl":25,"stars":24,"forks":28,"topics":31,"description":27},[],"https:\u002F\u002Fgithub.com\u002Fdbt-labs\u002Fade-bench\u002Ftree\u002FHEAD\u002Fskills\u002Fade-bench-cross-db-tasks","---\nname: ade-bench-cross-db-tasks\ndescription: Use when authoring or debugging ade-bench tasks that must run on both DuckDB and Snowflake, including shared project migrations, setup patches, and solution patches\n---\n\n# ADE-Bench Cross-DB Task Authoring\n\n## Overview\n\nTasks in ade-bench can target DuckDB (default) or Snowflake. A task's files go through a deterministic **four-stage lifecycle**. Patches that ignore this order produce context mismatches or \"reversed patch\" prompts that block execution.\n\n## Container Lifecycle (in order)\n\n```\n1. MIGRATION   shared\u002Fmigrations\u002F\u003Cname>\u002Fmigration.sh + migration.patch\n               — Converts shared project files from DuckDB to Snowflake syntax\n2. SETUP       tasks\u002F\u003Cid>\u002Fsetup.sh  +  tasks\u002F\u003Cid>\u002Fsetup\u002Fchanges.patch\n                                       tasks\u002F\u003Cid>\u002Fsetup\u002Fchanges.snowflake.patch (optional)\n               — Creates the puzzle state the agent must solve\n3. AGENT       (agent works here)\n4. SOLUTION    tasks\u002F\u003Cid>\u002Fsolution.sh  +  tasks\u002F\u003Cid>\u002Fsolutions\u002Fchanges.patch\n                                          tasks\u002F\u003Cid>\u002Fsolutions\u002Fchanges.snowflake.patch (optional)\n```\n\n**Critical:** Migration runs before setup and solution. Any line migration touches is in its post-migration state when patches run.\n\n## Patch File Pattern\n\nAlways apply the base patch, then conditionally apply the snowflake delta. This applies to both `setup.sh` and `solution.sh`:\n\n```bash\npatch -p1 \u003C \u002Fapp\u002Fsetup\u002Fchanges.patch           # always (use \u002Fsage\u002Fsolutions\u002F for solution.sh)\n\nif [[ \"$*\" == *\"--db-type=snowflake\"* ]]; then\n    patch -p1 \u003C \u002Fapp\u002Fsetup\u002Fchanges.snowflake.patch  # additive delta only\nfi\n```\n\n**Never** use if\u002Felse to choose between two alternative patches. The base patch handles DuckDB; the snowflake patch stacks on top for Snowflake.\n\n`changes.snowflake.patch` is a **delta** — it only contains changes that differ from the DuckDB result. It never replicates what migration already did.\n\n## Migration Guidelines\n\n**Migration's job:** Convert DuckDB-specific syntax to Snowflake equivalents across all tasks sharing a project.\n\n- Schema names: `schema: main` → `schema: public`\n- Date functions: `STRPTIME(...)` → `TO_DATE(TO_TIMESTAMP(...))`\n- Generator functions, STRFTIME, etc.\n\n**Don't add migration hunks for files that setup removes.** If setup strips a config block entirely, migration touching a field inside that block is wasted work that breaks setup's patch. Example: if `setup\u002Fchanges.patch` deletes an entire `{{ config(...) }}` block from `src_hosts.sql`, migration should not change `schema=` inside that same block.\n\n## Modifying dbt_project.yml: use yq, not patch\n\nThe migration process calls `yaml.safe_load` \u002F `yaml.safe_dump` on `dbt_project.yml` to update the profile name. This completely reformats the file — sorted keys, no comments, different whitespace. Any patch against the original layout will fail.\n\n**Use `yq` for all `dbt_project.yml` changes** in setup.sh and solution.sh:\n\n```bash\n# Add a variable\nyq -i '.vars.surrogate_key_treat_nulls_as_empty_strings = true' dbt_project.yml\n\n# Delete a variable\nyq -i 'del(.vars.quickbooks.using_department)' dbt_project.yml\n\n# Disable a package model\nyq -i '.models.quickbooks_source[\"stg_quickbooks__refund_receipt\"][\"+enabled\"] = false' dbt_project.yml\n```\n\n`yq` performs semantic YAML operations so key order and formatting don't matter.\n\n## Setup Patch Guidelines\n\nSetup creates the puzzle. `setup\u002Fchanges.patch` runs after migration.\n\n**When setup's base patch can't match post-migration content** (e.g. migration changed `schema=\"main\"` to `schema=\"public\"` in a line the setup patch must remove):\n\n```bash\n# setup.sh\npatch -p1 --batch \u003C \u002Fapp\u002Fsetup\u002Fchanges.patch || true   # graceful fail on Snowflake\n\nif [[ \"$*\" == *\"--db-type=snowflake\"* ]]; then\n    patch -p1 --batch --forward \u003C \u002Fapp\u002Fsetup\u002Fchanges.snowflake.patch\nfi\n```\n\n- `--batch`: prevents interactive \"Apply anyway?\" prompt (avoids blocking)\n- `--forward`: skips reversed\u002Falready-applied hunks without prompting\n- `|| true`: base patch may partially fail on Snowflake; that's expected\n\n`setup\u002Fchanges.snowflake.patch` is the DuckDB base patch with post-migration values substituted (e.g. `schema=\"public\"` instead of `schema=\"main\"` in the removed lines).\n\n## Solution Patch Guidelines\n\n### Context line mismatch (migration changed a context line)\n\nIf migration rewrites a line that appears as a **context line** (` `) in `changes.patch`, drop it from context:\n\n```diff\n# Before — STRPTIME is a context line; migration changes it to TO_DATE(...)\n @@ -11,7 +11,7 @@\n          transaction_type,\n          CAST(STRPTIME(transaction_created_date, '%m\u002F%d\u002F%Y %H:%M:%S') AS DATE) AS transaction_created_date,\n          transaction_modified_date,\n -        product_id,\n +        product_id::varchar AS product_id,\n\n# After — start hunk after the changed line, no STRPTIME context\n @@ -14,4 +14,4 @@\n -        product_id,\n +        product_id::varchar AS product_id,\n          quantity,\n          purchase_order_id,\n          customer_order_id,\n```\n\n### `-` line mismatch (migration changed a line being removed)\n\nIf migration rewrites a line that is a **`-` line** (a line being deleted), 0-context doesn't help — the removed line must match exactly. Use `changes.snowflake.patch` with the post-migration value:\n\n```patch\n# changes.snowflake.patch — removes config block after migration changed schema\n@@ -1,9 +1,0 @@\n-{{\n-    config(materialized=\"table\", schema=\"public\", ...)\n-}}\n-\n```\n\n### Never duplicate migration in the snowflake patch\n\nBefore adding anything to `changes.snowflake.patch`, check whether migration already makes that change. If migration already converts STRPTIME or changes schema, the solution patch must not repeat it — patch will detect it as reversed and block.\n\n## Quick Diagnosis\n\n| Symptom | Cause | Fix |\n|---------|-------|-----|\n| `Hunk #N FAILED` in solution | Migration changed a context line | Drop that context line from the hunk |\n| `Reversed patch detected! Assume -R?` | Snowflake patch duplicates migration | Delete or update the snowflake patch |\n| Setup `Hunk #1 FAILED` then solution fails | Migration changed a `-` line in setup patch | Add `setup\u002Fchanges.snowflake.patch` + `--batch \\|\\| true` |\n| `dbt_project.yml` patch fails on Snowflake | Migration reformatted the file via yaml.safe_dump | Switch to `yq` for all dbt_project.yml edits |\n| Silent wrong output | Base patch failed, no error shown | Add `set -e` or check with `--dry-run` |\n\n## Real Examples\n\n**analytics_engineering007** (`tasks\u002Fanalytics_engineering007\u002Fsolutions\u002Fchanges.patch`): Migration converts `CAST(STRPTIME(...))` → `TO_DATE(...)` in `fact_inventory.sql`. The solution's `changes.patch` had STRPTIME as a context line — fragile fuzz match. Fixed by starting the hunk at line 14 (`@@ -14,4`) instead of line 11 (`@@ -11,7`), skipping the migrated line entirely. The solution's snowflake patch (which also tried to convert STRPTIME) was deleted since migration already did it.\n\n**airbnb003** (`tasks\u002Fairbnb003\u002Fsetup\u002F`): Migration changes `schema=\"main\"` → `schema=\"public\"` inside the config block of `src_hosts.sql`. The setup's `changes.patch` removes that entire config block but has `schema=\"main\"` in the `-` lines — fails after migration. Fixed by adding `setup\u002Fchanges.snowflake.patch` (same removal with `schema=\"public\"`) and using `--batch || true` on the base patch so it fails gracefully, then the snowflake patch completes the removal.\n\n**airbnb002** (`tasks\u002Fairbnb002\u002Fsolution.sh`): Solution needs to add `surrogate_key_treat_nulls_as_empty_strings: true` to `dbt_project.yml`. Using patch fails because migration's yaml.safe_dump reformatted the file. Fixed with:\n```bash\nyq -i '.vars.surrogate_key_treat_nulls_as_empty_strings = true' dbt_project.yml\n```\n\n**quickbooks003** (`tasks\u002Fquickbooks003\u002Fsolution.sh`): Solution needs to disable three package models and delete a variable from `dbt_project.yml`. Patch was unreliable after migration reformatting. Fixed with yq:\n```bash\nyq -i '.models.quickbooks_source[\"stg_quickbooks__refund_receipt\"][\"+enabled\"] = false' dbt_project.yml\nyq -i 'del(.vars.quickbooks.using_department)' dbt_project.yml\n```\n",{"data":35,"body":36},{"name":4,"description":6},{"type":37,"children":38},"root",[39,48,55,69,75,88,98,104,125,284,294,312,318,328,375,417,423,452,477,613,623,629,641,667,820,856,881,887,894,922,1055,1067,1091,1147,1153,1165,1171,1357,1363,1426,1505,1536,1570,1594,1655],{"type":40,"tag":41,"props":42,"children":44},"element","h1",{"id":43},"ade-bench-cross-db-task-authoring",[45],{"type":46,"value":47},"text","ADE-Bench Cross-DB Task Authoring",{"type":40,"tag":49,"props":50,"children":52},"h2",{"id":51},"overview",[53],{"type":46,"value":54},"Overview",{"type":40,"tag":56,"props":57,"children":58},"p",{},[59,61,67],{"type":46,"value":60},"Tasks in ade-bench can target DuckDB (default) or Snowflake. A task's files go through a deterministic ",{"type":40,"tag":62,"props":63,"children":64},"strong",{},[65],{"type":46,"value":66},"four-stage lifecycle",{"type":46,"value":68},". Patches that ignore this order produce context mismatches or \"reversed patch\" prompts that block execution.",{"type":40,"tag":49,"props":70,"children":72},{"id":71},"container-lifecycle-in-order",[73],{"type":46,"value":74},"Container Lifecycle (in order)",{"type":40,"tag":76,"props":77,"children":81},"pre",{"className":78,"code":80,"language":46},[79],"language-text","1. MIGRATION   shared\u002Fmigrations\u002F\u003Cname>\u002Fmigration.sh + migration.patch\n               — Converts shared project files from DuckDB to Snowflake syntax\n2. SETUP       tasks\u002F\u003Cid>\u002Fsetup.sh  +  tasks\u002F\u003Cid>\u002Fsetup\u002Fchanges.patch\n                                       tasks\u002F\u003Cid>\u002Fsetup\u002Fchanges.snowflake.patch (optional)\n               — Creates the puzzle state the agent must solve\n3. AGENT       (agent works here)\n4. SOLUTION    tasks\u002F\u003Cid>\u002Fsolution.sh  +  tasks\u002F\u003Cid>\u002Fsolutions\u002Fchanges.patch\n                                          tasks\u002F\u003Cid>\u002Fsolutions\u002Fchanges.snowflake.patch (optional)\n",[82],{"type":40,"tag":83,"props":84,"children":86},"code",{"__ignoreMap":85},"",[87],{"type":46,"value":80},{"type":40,"tag":56,"props":89,"children":90},{},[91,96],{"type":40,"tag":62,"props":92,"children":93},{},[94],{"type":46,"value":95},"Critical:",{"type":46,"value":97}," Migration runs before setup and solution. Any line migration touches is in its post-migration state when patches run.",{"type":40,"tag":49,"props":99,"children":101},{"id":100},"patch-file-pattern",[102],{"type":46,"value":103},"Patch File Pattern",{"type":40,"tag":56,"props":105,"children":106},{},[107,109,115,117,123],{"type":46,"value":108},"Always apply the base patch, then conditionally apply the snowflake delta. This applies to both ",{"type":40,"tag":83,"props":110,"children":112},{"className":111},[],[113],{"type":46,"value":114},"setup.sh",{"type":46,"value":116}," and ",{"type":40,"tag":83,"props":118,"children":120},{"className":119},[],[121],{"type":46,"value":122},"solution.sh",{"type":46,"value":124},":",{"type":40,"tag":76,"props":126,"children":130},{"className":127,"code":128,"language":129,"meta":85,"style":85},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","patch -p1 \u003C \u002Fapp\u002Fsetup\u002Fchanges.patch           # always (use \u002Fsage\u002Fsolutions\u002F for solution.sh)\n\nif [[ \"$*\" == *\"--db-type=snowflake\"* ]]; then\n    patch -p1 \u003C \u002Fapp\u002Fsetup\u002Fchanges.snowflake.patch  # additive delta only\nfi\n","bash",[131],{"type":40,"tag":83,"props":132,"children":133},{"__ignoreMap":85},[134,169,179,248,275],{"type":40,"tag":135,"props":136,"children":139},"span",{"class":137,"line":138},"line",1,[140,146,152,158,163],{"type":40,"tag":135,"props":141,"children":143},{"style":142},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[144],{"type":46,"value":145},"patch",{"type":40,"tag":135,"props":147,"children":149},{"style":148},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[150],{"type":46,"value":151}," -p1",{"type":40,"tag":135,"props":153,"children":155},{"style":154},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[156],{"type":46,"value":157}," \u003C",{"type":40,"tag":135,"props":159,"children":160},{"style":148},[161],{"type":46,"value":162}," \u002Fapp\u002Fsetup\u002Fchanges.patch",{"type":40,"tag":135,"props":164,"children":166},{"style":165},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[167],{"type":46,"value":168},"           # always (use \u002Fsage\u002Fsolutions\u002F for solution.sh)\n",{"type":40,"tag":135,"props":170,"children":172},{"class":137,"line":171},2,[173],{"type":40,"tag":135,"props":174,"children":176},{"emptyLinePlaceholder":175},true,[177],{"type":46,"value":178},"\n",{"type":40,"tag":135,"props":180,"children":182},{"class":137,"line":181},3,[183,189,194,199,205,210,215,220,224,229,233,238,243],{"type":40,"tag":135,"props":184,"children":186},{"style":185},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[187],{"type":46,"value":188},"if",{"type":40,"tag":135,"props":190,"children":191},{"style":154},[192],{"type":46,"value":193}," [[",{"type":40,"tag":135,"props":195,"children":196},{"style":154},[197],{"type":46,"value":198}," \"",{"type":40,"tag":135,"props":200,"children":202},{"style":201},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[203],{"type":46,"value":204},"$*",{"type":40,"tag":135,"props":206,"children":207},{"style":154},[208],{"type":46,"value":209},"\"",{"type":40,"tag":135,"props":211,"children":212},{"style":154},[213],{"type":46,"value":214}," ==",{"type":40,"tag":135,"props":216,"children":217},{"style":154},[218],{"type":46,"value":219}," *",{"type":40,"tag":135,"props":221,"children":222},{"style":154},[223],{"type":46,"value":209},{"type":40,"tag":135,"props":225,"children":226},{"style":148},[227],{"type":46,"value":228},"--db-type=snowflake",{"type":40,"tag":135,"props":230,"children":231},{"style":154},[232],{"type":46,"value":209},{"type":40,"tag":135,"props":234,"children":235},{"style":154},[236],{"type":46,"value":237},"*",{"type":40,"tag":135,"props":239,"children":240},{"style":154},[241],{"type":46,"value":242}," ]];",{"type":40,"tag":135,"props":244,"children":245},{"style":185},[246],{"type":46,"value":247}," then\n",{"type":40,"tag":135,"props":249,"children":251},{"class":137,"line":250},4,[252,257,261,265,270],{"type":40,"tag":135,"props":253,"children":254},{"style":142},[255],{"type":46,"value":256},"    patch",{"type":40,"tag":135,"props":258,"children":259},{"style":148},[260],{"type":46,"value":151},{"type":40,"tag":135,"props":262,"children":263},{"style":154},[264],{"type":46,"value":157},{"type":40,"tag":135,"props":266,"children":267},{"style":148},[268],{"type":46,"value":269}," \u002Fapp\u002Fsetup\u002Fchanges.snowflake.patch",{"type":40,"tag":135,"props":271,"children":272},{"style":165},[273],{"type":46,"value":274},"  # additive delta only\n",{"type":40,"tag":135,"props":276,"children":278},{"class":137,"line":277},5,[279],{"type":40,"tag":135,"props":280,"children":281},{"style":185},[282],{"type":46,"value":283},"fi\n",{"type":40,"tag":56,"props":285,"children":286},{},[287,292],{"type":40,"tag":62,"props":288,"children":289},{},[290],{"type":46,"value":291},"Never",{"type":46,"value":293}," use if\u002Felse to choose between two alternative patches. The base patch handles DuckDB; the snowflake patch stacks on top for Snowflake.",{"type":40,"tag":56,"props":295,"children":296},{},[297,303,305,310],{"type":40,"tag":83,"props":298,"children":300},{"className":299},[],[301],{"type":46,"value":302},"changes.snowflake.patch",{"type":46,"value":304}," is a ",{"type":40,"tag":62,"props":306,"children":307},{},[308],{"type":46,"value":309},"delta",{"type":46,"value":311}," — it only contains changes that differ from the DuckDB result. It never replicates what migration already did.",{"type":40,"tag":49,"props":313,"children":315},{"id":314},"migration-guidelines",[316],{"type":46,"value":317},"Migration Guidelines",{"type":40,"tag":56,"props":319,"children":320},{},[321,326],{"type":40,"tag":62,"props":322,"children":323},{},[324],{"type":46,"value":325},"Migration's job:",{"type":46,"value":327}," Convert DuckDB-specific syntax to Snowflake equivalents across all tasks sharing a project.",{"type":40,"tag":329,"props":330,"children":331},"ul",{},[332,352,370],{"type":40,"tag":333,"props":334,"children":335},"li",{},[336,338,344,346],{"type":46,"value":337},"Schema names: ",{"type":40,"tag":83,"props":339,"children":341},{"className":340},[],[342],{"type":46,"value":343},"schema: main",{"type":46,"value":345}," → ",{"type":40,"tag":83,"props":347,"children":349},{"className":348},[],[350],{"type":46,"value":351},"schema: public",{"type":40,"tag":333,"props":353,"children":354},{},[355,357,363,364],{"type":46,"value":356},"Date functions: ",{"type":40,"tag":83,"props":358,"children":360},{"className":359},[],[361],{"type":46,"value":362},"STRPTIME(...)",{"type":46,"value":345},{"type":40,"tag":83,"props":365,"children":367},{"className":366},[],[368],{"type":46,"value":369},"TO_DATE(TO_TIMESTAMP(...))",{"type":40,"tag":333,"props":371,"children":372},{},[373],{"type":46,"value":374},"Generator functions, STRFTIME, etc.",{"type":40,"tag":56,"props":376,"children":377},{},[378,383,385,391,393,399,401,407,409,415],{"type":40,"tag":62,"props":379,"children":380},{},[381],{"type":46,"value":382},"Don't add migration hunks for files that setup removes.",{"type":46,"value":384}," If setup strips a config block entirely, migration touching a field inside that block is wasted work that breaks setup's patch. Example: if ",{"type":40,"tag":83,"props":386,"children":388},{"className":387},[],[389],{"type":46,"value":390},"setup\u002Fchanges.patch",{"type":46,"value":392}," deletes an entire ",{"type":40,"tag":83,"props":394,"children":396},{"className":395},[],[397],{"type":46,"value":398},"{{ config(...) }}",{"type":46,"value":400}," block from ",{"type":40,"tag":83,"props":402,"children":404},{"className":403},[],[405],{"type":46,"value":406},"src_hosts.sql",{"type":46,"value":408},", migration should not change ",{"type":40,"tag":83,"props":410,"children":412},{"className":411},[],[413],{"type":46,"value":414},"schema=",{"type":46,"value":416}," inside that same block.",{"type":40,"tag":49,"props":418,"children":420},{"id":419},"modifying-dbt_projectyml-use-yq-not-patch",[421],{"type":46,"value":422},"Modifying dbt_project.yml: use yq, not patch",{"type":40,"tag":56,"props":424,"children":425},{},[426,428,434,436,442,444,450],{"type":46,"value":427},"The migration process calls ",{"type":40,"tag":83,"props":429,"children":431},{"className":430},[],[432],{"type":46,"value":433},"yaml.safe_load",{"type":46,"value":435}," \u002F ",{"type":40,"tag":83,"props":437,"children":439},{"className":438},[],[440],{"type":46,"value":441},"yaml.safe_dump",{"type":46,"value":443}," on ",{"type":40,"tag":83,"props":445,"children":447},{"className":446},[],[448],{"type":46,"value":449},"dbt_project.yml",{"type":46,"value":451}," to update the profile name. This completely reformats the file — sorted keys, no comments, different whitespace. Any patch against the original layout will fail.",{"type":40,"tag":56,"props":453,"children":454},{},[455,475],{"type":40,"tag":62,"props":456,"children":457},{},[458,460,466,468,473],{"type":46,"value":459},"Use ",{"type":40,"tag":83,"props":461,"children":463},{"className":462},[],[464],{"type":46,"value":465},"yq",{"type":46,"value":467}," for all ",{"type":40,"tag":83,"props":469,"children":471},{"className":470},[],[472],{"type":46,"value":449},{"type":46,"value":474}," changes",{"type":46,"value":476}," in setup.sh and solution.sh:",{"type":40,"tag":76,"props":478,"children":480},{"className":127,"code":479,"language":129,"meta":85,"style":85},"# Add a variable\nyq -i '.vars.surrogate_key_treat_nulls_as_empty_strings = true' dbt_project.yml\n\n# Delete a variable\nyq -i 'del(.vars.quickbooks.using_department)' dbt_project.yml\n\n# Disable a package model\nyq -i '.models.quickbooks_source[\"stg_quickbooks__refund_receipt\"][\"+enabled\"] = false' dbt_project.yml\n",[481],{"type":40,"tag":83,"props":482,"children":483},{"__ignoreMap":85},[484,492,524,531,539,567,575,584],{"type":40,"tag":135,"props":485,"children":486},{"class":137,"line":138},[487],{"type":40,"tag":135,"props":488,"children":489},{"style":165},[490],{"type":46,"value":491},"# Add a variable\n",{"type":40,"tag":135,"props":493,"children":494},{"class":137,"line":171},[495,499,504,509,514,519],{"type":40,"tag":135,"props":496,"children":497},{"style":142},[498],{"type":46,"value":465},{"type":40,"tag":135,"props":500,"children":501},{"style":148},[502],{"type":46,"value":503}," -i",{"type":40,"tag":135,"props":505,"children":506},{"style":154},[507],{"type":46,"value":508}," '",{"type":40,"tag":135,"props":510,"children":511},{"style":148},[512],{"type":46,"value":513},".vars.surrogate_key_treat_nulls_as_empty_strings = true",{"type":40,"tag":135,"props":515,"children":516},{"style":154},[517],{"type":46,"value":518},"'",{"type":40,"tag":135,"props":520,"children":521},{"style":148},[522],{"type":46,"value":523}," dbt_project.yml\n",{"type":40,"tag":135,"props":525,"children":526},{"class":137,"line":181},[527],{"type":40,"tag":135,"props":528,"children":529},{"emptyLinePlaceholder":175},[530],{"type":46,"value":178},{"type":40,"tag":135,"props":532,"children":533},{"class":137,"line":250},[534],{"type":40,"tag":135,"props":535,"children":536},{"style":165},[537],{"type":46,"value":538},"# Delete a variable\n",{"type":40,"tag":135,"props":540,"children":541},{"class":137,"line":277},[542,546,550,554,559,563],{"type":40,"tag":135,"props":543,"children":544},{"style":142},[545],{"type":46,"value":465},{"type":40,"tag":135,"props":547,"children":548},{"style":148},[549],{"type":46,"value":503},{"type":40,"tag":135,"props":551,"children":552},{"style":154},[553],{"type":46,"value":508},{"type":40,"tag":135,"props":555,"children":556},{"style":148},[557],{"type":46,"value":558},"del(.vars.quickbooks.using_department)",{"type":40,"tag":135,"props":560,"children":561},{"style":154},[562],{"type":46,"value":518},{"type":40,"tag":135,"props":564,"children":565},{"style":148},[566],{"type":46,"value":523},{"type":40,"tag":135,"props":568,"children":570},{"class":137,"line":569},6,[571],{"type":40,"tag":135,"props":572,"children":573},{"emptyLinePlaceholder":175},[574],{"type":46,"value":178},{"type":40,"tag":135,"props":576,"children":578},{"class":137,"line":577},7,[579],{"type":40,"tag":135,"props":580,"children":581},{"style":165},[582],{"type":46,"value":583},"# Disable a package model\n",{"type":40,"tag":135,"props":585,"children":587},{"class":137,"line":586},8,[588,592,596,600,605,609],{"type":40,"tag":135,"props":589,"children":590},{"style":142},[591],{"type":46,"value":465},{"type":40,"tag":135,"props":593,"children":594},{"style":148},[595],{"type":46,"value":503},{"type":40,"tag":135,"props":597,"children":598},{"style":154},[599],{"type":46,"value":508},{"type":40,"tag":135,"props":601,"children":602},{"style":148},[603],{"type":46,"value":604},".models.quickbooks_source[\"stg_quickbooks__refund_receipt\"][\"+enabled\"] = false",{"type":40,"tag":135,"props":606,"children":607},{"style":154},[608],{"type":46,"value":518},{"type":40,"tag":135,"props":610,"children":611},{"style":148},[612],{"type":46,"value":523},{"type":40,"tag":56,"props":614,"children":615},{},[616,621],{"type":40,"tag":83,"props":617,"children":619},{"className":618},[],[620],{"type":46,"value":465},{"type":46,"value":622}," performs semantic YAML operations so key order and formatting don't matter.",{"type":40,"tag":49,"props":624,"children":626},{"id":625},"setup-patch-guidelines",[627],{"type":46,"value":628},"Setup Patch Guidelines",{"type":40,"tag":56,"props":630,"children":631},{},[632,634,639],{"type":46,"value":633},"Setup creates the puzzle. ",{"type":40,"tag":83,"props":635,"children":637},{"className":636},[],[638],{"type":46,"value":390},{"type":46,"value":640}," runs after migration.",{"type":40,"tag":56,"props":642,"children":643},{},[644,649,651,657,659,665],{"type":40,"tag":62,"props":645,"children":646},{},[647],{"type":46,"value":648},"When setup's base patch can't match post-migration content",{"type":46,"value":650}," (e.g. migration changed ",{"type":40,"tag":83,"props":652,"children":654},{"className":653},[],[655],{"type":46,"value":656},"schema=\"main\"",{"type":46,"value":658}," to ",{"type":40,"tag":83,"props":660,"children":662},{"className":661},[],[663],{"type":46,"value":664},"schema=\"public\"",{"type":46,"value":666}," in a line the setup patch must remove):",{"type":40,"tag":76,"props":668,"children":670},{"className":127,"code":669,"language":129,"meta":85,"style":85},"# setup.sh\npatch -p1 --batch \u003C \u002Fapp\u002Fsetup\u002Fchanges.patch || true   # graceful fail on Snowflake\n\nif [[ \"$*\" == *\"--db-type=snowflake\"* ]]; then\n    patch -p1 --batch --forward \u003C \u002Fapp\u002Fsetup\u002Fchanges.snowflake.patch\nfi\n",[671],{"type":40,"tag":83,"props":672,"children":673},{"__ignoreMap":85},[674,682,722,729,784,813],{"type":40,"tag":135,"props":675,"children":676},{"class":137,"line":138},[677],{"type":40,"tag":135,"props":678,"children":679},{"style":165},[680],{"type":46,"value":681},"# setup.sh\n",{"type":40,"tag":135,"props":683,"children":684},{"class":137,"line":171},[685,689,693,698,702,706,711,717],{"type":40,"tag":135,"props":686,"children":687},{"style":142},[688],{"type":46,"value":145},{"type":40,"tag":135,"props":690,"children":691},{"style":148},[692],{"type":46,"value":151},{"type":40,"tag":135,"props":694,"children":695},{"style":148},[696],{"type":46,"value":697}," --batch",{"type":40,"tag":135,"props":699,"children":700},{"style":154},[701],{"type":46,"value":157},{"type":40,"tag":135,"props":703,"children":704},{"style":148},[705],{"type":46,"value":162},{"type":40,"tag":135,"props":707,"children":708},{"style":154},[709],{"type":46,"value":710}," ||",{"type":40,"tag":135,"props":712,"children":714},{"style":713},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[715],{"type":46,"value":716}," true",{"type":40,"tag":135,"props":718,"children":719},{"style":165},[720],{"type":46,"value":721},"   # graceful fail on Snowflake\n",{"type":40,"tag":135,"props":723,"children":724},{"class":137,"line":181},[725],{"type":40,"tag":135,"props":726,"children":727},{"emptyLinePlaceholder":175},[728],{"type":46,"value":178},{"type":40,"tag":135,"props":730,"children":731},{"class":137,"line":250},[732,736,740,744,748,752,756,760,764,768,772,776,780],{"type":40,"tag":135,"props":733,"children":734},{"style":185},[735],{"type":46,"value":188},{"type":40,"tag":135,"props":737,"children":738},{"style":154},[739],{"type":46,"value":193},{"type":40,"tag":135,"props":741,"children":742},{"style":154},[743],{"type":46,"value":198},{"type":40,"tag":135,"props":745,"children":746},{"style":201},[747],{"type":46,"value":204},{"type":40,"tag":135,"props":749,"children":750},{"style":154},[751],{"type":46,"value":209},{"type":40,"tag":135,"props":753,"children":754},{"style":154},[755],{"type":46,"value":214},{"type":40,"tag":135,"props":757,"children":758},{"style":154},[759],{"type":46,"value":219},{"type":40,"tag":135,"props":761,"children":762},{"style":154},[763],{"type":46,"value":209},{"type":40,"tag":135,"props":765,"children":766},{"style":148},[767],{"type":46,"value":228},{"type":40,"tag":135,"props":769,"children":770},{"style":154},[771],{"type":46,"value":209},{"type":40,"tag":135,"props":773,"children":774},{"style":154},[775],{"type":46,"value":237},{"type":40,"tag":135,"props":777,"children":778},{"style":154},[779],{"type":46,"value":242},{"type":40,"tag":135,"props":781,"children":782},{"style":185},[783],{"type":46,"value":247},{"type":40,"tag":135,"props":785,"children":786},{"class":137,"line":277},[787,791,795,799,804,808],{"type":40,"tag":135,"props":788,"children":789},{"style":142},[790],{"type":46,"value":256},{"type":40,"tag":135,"props":792,"children":793},{"style":148},[794],{"type":46,"value":151},{"type":40,"tag":135,"props":796,"children":797},{"style":148},[798],{"type":46,"value":697},{"type":40,"tag":135,"props":800,"children":801},{"style":148},[802],{"type":46,"value":803}," --forward",{"type":40,"tag":135,"props":805,"children":806},{"style":154},[807],{"type":46,"value":157},{"type":40,"tag":135,"props":809,"children":810},{"style":148},[811],{"type":46,"value":812}," \u002Fapp\u002Fsetup\u002Fchanges.snowflake.patch\n",{"type":40,"tag":135,"props":814,"children":815},{"class":137,"line":569},[816],{"type":40,"tag":135,"props":817,"children":818},{"style":185},[819],{"type":46,"value":283},{"type":40,"tag":329,"props":821,"children":822},{},[823,834,845],{"type":40,"tag":333,"props":824,"children":825},{},[826,832],{"type":40,"tag":83,"props":827,"children":829},{"className":828},[],[830],{"type":46,"value":831},"--batch",{"type":46,"value":833},": prevents interactive \"Apply anyway?\" prompt (avoids blocking)",{"type":40,"tag":333,"props":835,"children":836},{},[837,843],{"type":40,"tag":83,"props":838,"children":840},{"className":839},[],[841],{"type":46,"value":842},"--forward",{"type":46,"value":844},": skips reversed\u002Falready-applied hunks without prompting",{"type":40,"tag":333,"props":846,"children":847},{},[848,854],{"type":40,"tag":83,"props":849,"children":851},{"className":850},[],[852],{"type":46,"value":853},"|| true",{"type":46,"value":855},": base patch may partially fail on Snowflake; that's expected",{"type":40,"tag":56,"props":857,"children":858},{},[859,865,867,872,874,879],{"type":40,"tag":83,"props":860,"children":862},{"className":861},[],[863],{"type":46,"value":864},"setup\u002Fchanges.snowflake.patch",{"type":46,"value":866}," is the DuckDB base patch with post-migration values substituted (e.g. ",{"type":40,"tag":83,"props":868,"children":870},{"className":869},[],[871],{"type":46,"value":664},{"type":46,"value":873}," instead of ",{"type":40,"tag":83,"props":875,"children":877},{"className":876},[],[878],{"type":46,"value":656},{"type":46,"value":880}," in the removed lines).",{"type":40,"tag":49,"props":882,"children":884},{"id":883},"solution-patch-guidelines",[885],{"type":46,"value":886},"Solution Patch Guidelines",{"type":40,"tag":888,"props":889,"children":891},"h3",{"id":890},"context-line-mismatch-migration-changed-a-context-line",[892],{"type":46,"value":893},"Context line mismatch (migration changed a context line)",{"type":40,"tag":56,"props":895,"children":896},{},[897,899,904,906,912,914,920],{"type":46,"value":898},"If migration rewrites a line that appears as a ",{"type":40,"tag":62,"props":900,"children":901},{},[902],{"type":46,"value":903},"context line",{"type":46,"value":905}," (",{"type":40,"tag":83,"props":907,"children":909},{"className":908},[],[910],{"type":46,"value":911}," ",{"type":46,"value":913},") in ",{"type":40,"tag":83,"props":915,"children":917},{"className":916},[],[918],{"type":46,"value":919},"changes.patch",{"type":46,"value":921},", drop it from context:",{"type":40,"tag":76,"props":923,"children":927},{"className":924,"code":925,"language":926,"meta":85,"style":85},"language-diff shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","# Before — STRPTIME is a context line; migration changes it to TO_DATE(...)\n @@ -11,7 +11,7 @@\n          transaction_type,\n          CAST(STRPTIME(transaction_created_date, '%m\u002F%d\u002F%Y %H:%M:%S') AS DATE) AS transaction_created_date,\n          transaction_modified_date,\n -        product_id,\n +        product_id::varchar AS product_id,\n\n# After — start hunk after the changed line, no STRPTIME context\n @@ -14,4 +14,4 @@\n -        product_id,\n +        product_id::varchar AS product_id,\n          quantity,\n          purchase_order_id,\n          customer_order_id,\n","diff",[928],{"type":40,"tag":83,"props":929,"children":930},{"__ignoreMap":85},[931,939,947,955,963,971,979,987,994,1003,1012,1020,1028,1037,1046],{"type":40,"tag":135,"props":932,"children":933},{"class":137,"line":138},[934],{"type":40,"tag":135,"props":935,"children":936},{},[937],{"type":46,"value":938},"# Before — STRPTIME is a context line; migration changes it to TO_DATE(...)\n",{"type":40,"tag":135,"props":940,"children":941},{"class":137,"line":171},[942],{"type":40,"tag":135,"props":943,"children":944},{},[945],{"type":46,"value":946}," @@ -11,7 +11,7 @@\n",{"type":40,"tag":135,"props":948,"children":949},{"class":137,"line":181},[950],{"type":40,"tag":135,"props":951,"children":952},{},[953],{"type":46,"value":954},"          transaction_type,\n",{"type":40,"tag":135,"props":956,"children":957},{"class":137,"line":250},[958],{"type":40,"tag":135,"props":959,"children":960},{},[961],{"type":46,"value":962},"          CAST(STRPTIME(transaction_created_date, '%m\u002F%d\u002F%Y %H:%M:%S') AS DATE) AS transaction_created_date,\n",{"type":40,"tag":135,"props":964,"children":965},{"class":137,"line":277},[966],{"type":40,"tag":135,"props":967,"children":968},{},[969],{"type":46,"value":970},"          transaction_modified_date,\n",{"type":40,"tag":135,"props":972,"children":973},{"class":137,"line":569},[974],{"type":40,"tag":135,"props":975,"children":976},{},[977],{"type":46,"value":978}," -        product_id,\n",{"type":40,"tag":135,"props":980,"children":981},{"class":137,"line":577},[982],{"type":40,"tag":135,"props":983,"children":984},{},[985],{"type":46,"value":986}," +        product_id::varchar AS product_id,\n",{"type":40,"tag":135,"props":988,"children":989},{"class":137,"line":586},[990],{"type":40,"tag":135,"props":991,"children":992},{"emptyLinePlaceholder":175},[993],{"type":46,"value":178},{"type":40,"tag":135,"props":995,"children":997},{"class":137,"line":996},9,[998],{"type":40,"tag":135,"props":999,"children":1000},{},[1001],{"type":46,"value":1002},"# After — start hunk after the changed line, no STRPTIME context\n",{"type":40,"tag":135,"props":1004,"children":1006},{"class":137,"line":1005},10,[1007],{"type":40,"tag":135,"props":1008,"children":1009},{},[1010],{"type":46,"value":1011}," @@ -14,4 +14,4 @@\n",{"type":40,"tag":135,"props":1013,"children":1015},{"class":137,"line":1014},11,[1016],{"type":40,"tag":135,"props":1017,"children":1018},{},[1019],{"type":46,"value":978},{"type":40,"tag":135,"props":1021,"children":1023},{"class":137,"line":1022},12,[1024],{"type":40,"tag":135,"props":1025,"children":1026},{},[1027],{"type":46,"value":986},{"type":40,"tag":135,"props":1029,"children":1031},{"class":137,"line":1030},13,[1032],{"type":40,"tag":135,"props":1033,"children":1034},{},[1035],{"type":46,"value":1036},"          quantity,\n",{"type":40,"tag":135,"props":1038,"children":1040},{"class":137,"line":1039},14,[1041],{"type":40,"tag":135,"props":1042,"children":1043},{},[1044],{"type":46,"value":1045},"          purchase_order_id,\n",{"type":40,"tag":135,"props":1047,"children":1049},{"class":137,"line":1048},15,[1050],{"type":40,"tag":135,"props":1051,"children":1052},{},[1053],{"type":46,"value":1054},"          customer_order_id,\n",{"type":40,"tag":888,"props":1056,"children":1058},{"id":1057},"line-mismatch-migration-changed-a-line-being-removed",[1059,1065],{"type":40,"tag":83,"props":1060,"children":1062},{"className":1061},[],[1063],{"type":46,"value":1064},"-",{"type":46,"value":1066}," line mismatch (migration changed a line being removed)",{"type":40,"tag":56,"props":1068,"children":1069},{},[1070,1072,1082,1084,1089],{"type":46,"value":1071},"If migration rewrites a line that is a ",{"type":40,"tag":62,"props":1073,"children":1074},{},[1075,1080],{"type":40,"tag":83,"props":1076,"children":1078},{"className":1077},[],[1079],{"type":46,"value":1064},{"type":46,"value":1081}," line",{"type":46,"value":1083}," (a line being deleted), 0-context doesn't help — the removed line must match exactly. Use ",{"type":40,"tag":83,"props":1085,"children":1087},{"className":1086},[],[1088],{"type":46,"value":302},{"type":46,"value":1090}," with the post-migration value:",{"type":40,"tag":76,"props":1092,"children":1095},{"className":1093,"code":1094,"language":145,"meta":85,"style":85},"language-patch shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","# changes.snowflake.patch — removes config block after migration changed schema\n@@ -1,9 +1,0 @@\n-{{\n-    config(materialized=\"table\", schema=\"public\", ...)\n-}}\n-\n",[1096],{"type":40,"tag":83,"props":1097,"children":1098},{"__ignoreMap":85},[1099,1107,1115,1123,1131,1139],{"type":40,"tag":135,"props":1100,"children":1101},{"class":137,"line":138},[1102],{"type":40,"tag":135,"props":1103,"children":1104},{},[1105],{"type":46,"value":1106},"# changes.snowflake.patch — removes config block after migration changed schema\n",{"type":40,"tag":135,"props":1108,"children":1109},{"class":137,"line":171},[1110],{"type":40,"tag":135,"props":1111,"children":1112},{},[1113],{"type":46,"value":1114},"@@ -1,9 +1,0 @@\n",{"type":40,"tag":135,"props":1116,"children":1117},{"class":137,"line":181},[1118],{"type":40,"tag":135,"props":1119,"children":1120},{},[1121],{"type":46,"value":1122},"-{{\n",{"type":40,"tag":135,"props":1124,"children":1125},{"class":137,"line":250},[1126],{"type":40,"tag":135,"props":1127,"children":1128},{},[1129],{"type":46,"value":1130},"-    config(materialized=\"table\", schema=\"public\", ...)\n",{"type":40,"tag":135,"props":1132,"children":1133},{"class":137,"line":277},[1134],{"type":40,"tag":135,"props":1135,"children":1136},{},[1137],{"type":46,"value":1138},"-}}\n",{"type":40,"tag":135,"props":1140,"children":1141},{"class":137,"line":569},[1142],{"type":40,"tag":135,"props":1143,"children":1144},{},[1145],{"type":46,"value":1146},"-\n",{"type":40,"tag":888,"props":1148,"children":1150},{"id":1149},"never-duplicate-migration-in-the-snowflake-patch",[1151],{"type":46,"value":1152},"Never duplicate migration in the snowflake patch",{"type":40,"tag":56,"props":1154,"children":1155},{},[1156,1158,1163],{"type":46,"value":1157},"Before adding anything to ",{"type":40,"tag":83,"props":1159,"children":1161},{"className":1160},[],[1162],{"type":46,"value":302},{"type":46,"value":1164},", check whether migration already makes that change. If migration already converts STRPTIME or changes schema, the solution patch must not repeat it — patch will detect it as reversed and block.",{"type":40,"tag":49,"props":1166,"children":1168},{"id":1167},"quick-diagnosis",[1169],{"type":46,"value":1170},"Quick Diagnosis",{"type":40,"tag":1172,"props":1173,"children":1174},"table",{},[1175,1199],{"type":40,"tag":1176,"props":1177,"children":1178},"thead",{},[1179],{"type":40,"tag":1180,"props":1181,"children":1182},"tr",{},[1183,1189,1194],{"type":40,"tag":1184,"props":1185,"children":1186},"th",{},[1187],{"type":46,"value":1188},"Symptom",{"type":40,"tag":1184,"props":1190,"children":1191},{},[1192],{"type":46,"value":1193},"Cause",{"type":40,"tag":1184,"props":1195,"children":1196},{},[1197],{"type":46,"value":1198},"Fix",{"type":40,"tag":1200,"props":1201,"children":1202},"tbody",{},[1203,1228,1250,1296,1326],{"type":40,"tag":1180,"props":1204,"children":1205},{},[1206,1218,1223],{"type":40,"tag":1207,"props":1208,"children":1209},"td",{},[1210,1216],{"type":40,"tag":83,"props":1211,"children":1213},{"className":1212},[],[1214],{"type":46,"value":1215},"Hunk #N FAILED",{"type":46,"value":1217}," in solution",{"type":40,"tag":1207,"props":1219,"children":1220},{},[1221],{"type":46,"value":1222},"Migration changed a context line",{"type":40,"tag":1207,"props":1224,"children":1225},{},[1226],{"type":46,"value":1227},"Drop that context line from the hunk",{"type":40,"tag":1180,"props":1229,"children":1230},{},[1231,1240,1245],{"type":40,"tag":1207,"props":1232,"children":1233},{},[1234],{"type":40,"tag":83,"props":1235,"children":1237},{"className":1236},[],[1238],{"type":46,"value":1239},"Reversed patch detected! Assume -R?",{"type":40,"tag":1207,"props":1241,"children":1242},{},[1243],{"type":46,"value":1244},"Snowflake patch duplicates migration",{"type":40,"tag":1207,"props":1246,"children":1247},{},[1248],{"type":46,"value":1249},"Delete or update the snowflake patch",{"type":40,"tag":1180,"props":1251,"children":1252},{},[1253,1266,1278],{"type":40,"tag":1207,"props":1254,"children":1255},{},[1256,1258,1264],{"type":46,"value":1257},"Setup ",{"type":40,"tag":83,"props":1259,"children":1261},{"className":1260},[],[1262],{"type":46,"value":1263},"Hunk #1 FAILED",{"type":46,"value":1265}," then solution fails",{"type":40,"tag":1207,"props":1267,"children":1268},{},[1269,1271,1276],{"type":46,"value":1270},"Migration changed a ",{"type":40,"tag":83,"props":1272,"children":1274},{"className":1273},[],[1275],{"type":46,"value":1064},{"type":46,"value":1277}," line in setup patch",{"type":40,"tag":1207,"props":1279,"children":1280},{},[1281,1283,1288,1290],{"type":46,"value":1282},"Add ",{"type":40,"tag":83,"props":1284,"children":1286},{"className":1285},[],[1287],{"type":46,"value":864},{"type":46,"value":1289}," + ",{"type":40,"tag":83,"props":1291,"children":1293},{"className":1292},[],[1294],{"type":46,"value":1295},"--batch || true",{"type":40,"tag":1180,"props":1297,"children":1298},{},[1299,1309,1314],{"type":40,"tag":1207,"props":1300,"children":1301},{},[1302,1307],{"type":40,"tag":83,"props":1303,"children":1305},{"className":1304},[],[1306],{"type":46,"value":449},{"type":46,"value":1308}," patch fails on Snowflake",{"type":40,"tag":1207,"props":1310,"children":1311},{},[1312],{"type":46,"value":1313},"Migration reformatted the file via yaml.safe_dump",{"type":40,"tag":1207,"props":1315,"children":1316},{},[1317,1319,1324],{"type":46,"value":1318},"Switch to ",{"type":40,"tag":83,"props":1320,"children":1322},{"className":1321},[],[1323],{"type":46,"value":465},{"type":46,"value":1325}," for all dbt_project.yml edits",{"type":40,"tag":1180,"props":1327,"children":1328},{},[1329,1334,1339],{"type":40,"tag":1207,"props":1330,"children":1331},{},[1332],{"type":46,"value":1333},"Silent wrong output",{"type":40,"tag":1207,"props":1335,"children":1336},{},[1337],{"type":46,"value":1338},"Base patch failed, no error shown",{"type":40,"tag":1207,"props":1340,"children":1341},{},[1342,1343,1349,1351],{"type":46,"value":1282},{"type":40,"tag":83,"props":1344,"children":1346},{"className":1345},[],[1347],{"type":46,"value":1348},"set -e",{"type":46,"value":1350}," or check with ",{"type":40,"tag":83,"props":1352,"children":1354},{"className":1353},[],[1355],{"type":46,"value":1356},"--dry-run",{"type":40,"tag":49,"props":1358,"children":1360},{"id":1359},"real-examples",[1361],{"type":46,"value":1362},"Real Examples",{"type":40,"tag":56,"props":1364,"children":1365},{},[1366,1371,1372,1378,1380,1386,1387,1393,1395,1401,1403,1408,1410,1416,1418,1424],{"type":40,"tag":62,"props":1367,"children":1368},{},[1369],{"type":46,"value":1370},"analytics_engineering007",{"type":46,"value":905},{"type":40,"tag":83,"props":1373,"children":1375},{"className":1374},[],[1376],{"type":46,"value":1377},"tasks\u002Fanalytics_engineering007\u002Fsolutions\u002Fchanges.patch",{"type":46,"value":1379},"): Migration converts ",{"type":40,"tag":83,"props":1381,"children":1383},{"className":1382},[],[1384],{"type":46,"value":1385},"CAST(STRPTIME(...))",{"type":46,"value":345},{"type":40,"tag":83,"props":1388,"children":1390},{"className":1389},[],[1391],{"type":46,"value":1392},"TO_DATE(...)",{"type":46,"value":1394}," in ",{"type":40,"tag":83,"props":1396,"children":1398},{"className":1397},[],[1399],{"type":46,"value":1400},"fact_inventory.sql",{"type":46,"value":1402},". The solution's ",{"type":40,"tag":83,"props":1404,"children":1406},{"className":1405},[],[1407],{"type":46,"value":919},{"type":46,"value":1409}," had STRPTIME as a context line — fragile fuzz match. Fixed by starting the hunk at line 14 (",{"type":40,"tag":83,"props":1411,"children":1413},{"className":1412},[],[1414],{"type":46,"value":1415},"@@ -14,4",{"type":46,"value":1417},") instead of line 11 (",{"type":40,"tag":83,"props":1419,"children":1421},{"className":1420},[],[1422],{"type":46,"value":1423},"@@ -11,7",{"type":46,"value":1425},"), skipping the migrated line entirely. The solution's snowflake patch (which also tried to convert STRPTIME) was deleted since migration already did it.",{"type":40,"tag":56,"props":1427,"children":1428},{},[1429,1434,1435,1441,1443,1448,1449,1454,1456,1461,1463,1468,1470,1475,1477,1482,1484,1489,1491,1496,1498,1503],{"type":40,"tag":62,"props":1430,"children":1431},{},[1432],{"type":46,"value":1433},"airbnb003",{"type":46,"value":905},{"type":40,"tag":83,"props":1436,"children":1438},{"className":1437},[],[1439],{"type":46,"value":1440},"tasks\u002Fairbnb003\u002Fsetup\u002F",{"type":46,"value":1442},"): Migration changes ",{"type":40,"tag":83,"props":1444,"children":1446},{"className":1445},[],[1447],{"type":46,"value":656},{"type":46,"value":345},{"type":40,"tag":83,"props":1450,"children":1452},{"className":1451},[],[1453],{"type":46,"value":664},{"type":46,"value":1455}," inside the config block of ",{"type":40,"tag":83,"props":1457,"children":1459},{"className":1458},[],[1460],{"type":46,"value":406},{"type":46,"value":1462},". The setup's ",{"type":40,"tag":83,"props":1464,"children":1466},{"className":1465},[],[1467],{"type":46,"value":919},{"type":46,"value":1469}," removes that entire config block but has ",{"type":40,"tag":83,"props":1471,"children":1473},{"className":1472},[],[1474],{"type":46,"value":656},{"type":46,"value":1476}," in the ",{"type":40,"tag":83,"props":1478,"children":1480},{"className":1479},[],[1481],{"type":46,"value":1064},{"type":46,"value":1483}," lines — fails after migration. Fixed by adding ",{"type":40,"tag":83,"props":1485,"children":1487},{"className":1486},[],[1488],{"type":46,"value":864},{"type":46,"value":1490}," (same removal with ",{"type":40,"tag":83,"props":1492,"children":1494},{"className":1493},[],[1495],{"type":46,"value":664},{"type":46,"value":1497},") and using ",{"type":40,"tag":83,"props":1499,"children":1501},{"className":1500},[],[1502],{"type":46,"value":1295},{"type":46,"value":1504}," on the base patch so it fails gracefully, then the snowflake patch completes the removal.",{"type":40,"tag":56,"props":1506,"children":1507},{},[1508,1513,1514,1520,1522,1528,1529,1534],{"type":40,"tag":62,"props":1509,"children":1510},{},[1511],{"type":46,"value":1512},"airbnb002",{"type":46,"value":905},{"type":40,"tag":83,"props":1515,"children":1517},{"className":1516},[],[1518],{"type":46,"value":1519},"tasks\u002Fairbnb002\u002Fsolution.sh",{"type":46,"value":1521},"): Solution needs to add ",{"type":40,"tag":83,"props":1523,"children":1525},{"className":1524},[],[1526],{"type":46,"value":1527},"surrogate_key_treat_nulls_as_empty_strings: true",{"type":46,"value":658},{"type":40,"tag":83,"props":1530,"children":1532},{"className":1531},[],[1533],{"type":46,"value":449},{"type":46,"value":1535},". Using patch fails because migration's yaml.safe_dump reformatted the file. Fixed with:",{"type":40,"tag":76,"props":1537,"children":1539},{"className":127,"code":1538,"language":129,"meta":85,"style":85},"yq -i '.vars.surrogate_key_treat_nulls_as_empty_strings = true' dbt_project.yml\n",[1540],{"type":40,"tag":83,"props":1541,"children":1542},{"__ignoreMap":85},[1543],{"type":40,"tag":135,"props":1544,"children":1545},{"class":137,"line":138},[1546,1550,1554,1558,1562,1566],{"type":40,"tag":135,"props":1547,"children":1548},{"style":142},[1549],{"type":46,"value":465},{"type":40,"tag":135,"props":1551,"children":1552},{"style":148},[1553],{"type":46,"value":503},{"type":40,"tag":135,"props":1555,"children":1556},{"style":154},[1557],{"type":46,"value":508},{"type":40,"tag":135,"props":1559,"children":1560},{"style":148},[1561],{"type":46,"value":513},{"type":40,"tag":135,"props":1563,"children":1564},{"style":154},[1565],{"type":46,"value":518},{"type":40,"tag":135,"props":1567,"children":1568},{"style":148},[1569],{"type":46,"value":523},{"type":40,"tag":56,"props":1571,"children":1572},{},[1573,1578,1579,1585,1587,1592],{"type":40,"tag":62,"props":1574,"children":1575},{},[1576],{"type":46,"value":1577},"quickbooks003",{"type":46,"value":905},{"type":40,"tag":83,"props":1580,"children":1582},{"className":1581},[],[1583],{"type":46,"value":1584},"tasks\u002Fquickbooks003\u002Fsolution.sh",{"type":46,"value":1586},"): Solution needs to disable three package models and delete a variable from ",{"type":40,"tag":83,"props":1588,"children":1590},{"className":1589},[],[1591],{"type":46,"value":449},{"type":46,"value":1593},". Patch was unreliable after migration reformatting. Fixed with yq:",{"type":40,"tag":76,"props":1595,"children":1597},{"className":127,"code":1596,"language":129,"meta":85,"style":85},"yq -i '.models.quickbooks_source[\"stg_quickbooks__refund_receipt\"][\"+enabled\"] = false' dbt_project.yml\nyq -i 'del(.vars.quickbooks.using_department)' dbt_project.yml\n",[1598],{"type":40,"tag":83,"props":1599,"children":1600},{"__ignoreMap":85},[1601,1628],{"type":40,"tag":135,"props":1602,"children":1603},{"class":137,"line":138},[1604,1608,1612,1616,1620,1624],{"type":40,"tag":135,"props":1605,"children":1606},{"style":142},[1607],{"type":46,"value":465},{"type":40,"tag":135,"props":1609,"children":1610},{"style":148},[1611],{"type":46,"value":503},{"type":40,"tag":135,"props":1613,"children":1614},{"style":154},[1615],{"type":46,"value":508},{"type":40,"tag":135,"props":1617,"children":1618},{"style":148},[1619],{"type":46,"value":604},{"type":40,"tag":135,"props":1621,"children":1622},{"style":154},[1623],{"type":46,"value":518},{"type":40,"tag":135,"props":1625,"children":1626},{"style":148},[1627],{"type":46,"value":523},{"type":40,"tag":135,"props":1629,"children":1630},{"class":137,"line":171},[1631,1635,1639,1643,1647,1651],{"type":40,"tag":135,"props":1632,"children":1633},{"style":142},[1634],{"type":46,"value":465},{"type":40,"tag":135,"props":1636,"children":1637},{"style":148},[1638],{"type":46,"value":503},{"type":40,"tag":135,"props":1640,"children":1641},{"style":154},[1642],{"type":46,"value":508},{"type":40,"tag":135,"props":1644,"children":1645},{"style":148},[1646],{"type":46,"value":558},{"type":40,"tag":135,"props":1648,"children":1649},{"style":154},[1650],{"type":46,"value":518},{"type":40,"tag":135,"props":1652,"children":1653},{"style":148},[1654],{"type":46,"value":523},{"type":40,"tag":1656,"props":1657,"children":1658},"style",{},[1659],{"type":46,"value":1660},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":1662,"total":138},[1663],{"slug":4,"name":4,"fn":5,"description":6,"org":1664,"tags":1665,"stars":24,"repoUrl":25,"updatedAt":26},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1666,1667,1668,1669],{"name":13,"slug":14,"type":15},{"name":17,"slug":17,"type":15},{"name":19,"slug":20,"type":15},{"name":22,"slug":23,"type":15},{"items":1671,"total":1835},[1672,1686,1704,1717,1731,1748,1760,1775,1787,1799,1811,1822],{"slug":1673,"name":1673,"fn":1674,"description":1675,"org":1676,"tags":1677,"stars":1683,"repoUrl":1684,"updatedAt":1685},"adding-dbt-unit-test","add dbt unit tests","Creates unit test YAML definitions that mock upstream model inputs and validate expected outputs. Use when adding unit tests for a dbt model or practicing test-driven development (TDD) in dbt.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1678,1679,1680],{"name":17,"slug":17,"type":15},{"name":22,"slug":23,"type":15},{"name":1681,"slug":1682,"type":15},"YAML","yaml",623,"https:\u002F\u002Fgithub.com\u002Fdbt-labs\u002Fdbt-agent-skills","2026-04-06T18:09:14.01391",{"slug":1687,"name":1687,"fn":1688,"description":1689,"org":1690,"tags":1691,"stars":1683,"repoUrl":1684,"updatedAt":1703},"answering-natural-language-questions-with-dbt","answer business questions using dbt Semantic Layer","Writes and executes SQL queries against the data warehouse using dbt's Semantic Layer or ad-hoc SQL to answer business questions. Use when a user asks about analytics, metrics, KPIs, or data (e.g., \"What were total sales last quarter?\", \"Show me top customers by revenue\"). NOT for validating, testing, or building dbt models during development.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1692,1695,1698,1699,1702],{"name":1693,"slug":1694,"type":15},"Analytics","analytics",{"name":1696,"slug":1697,"type":15},"Data Analysis","data-analysis",{"name":17,"slug":17,"type":15},{"name":1700,"slug":1701,"type":15},"Metrics","metrics",{"name":19,"slug":20,"type":15},"2026-04-06T18:09:07.651959",{"slug":1705,"name":1705,"fn":1706,"description":1707,"org":1708,"tags":1709,"stars":1683,"repoUrl":1684,"updatedAt":1716},"building-dbt-semantic-layer","build dbt Semantic Layer components","Use when creating or modifying dbt Semantic Layer components — semantic models, metrics, dimensions, entities, measures, or time spines. Covers MetricFlow configuration, metric types (simple, derived, cumulative, ratio, conversion), and validation for both latest and legacy YAML specs.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1710,1711,1714,1715],{"name":1693,"slug":1694,"type":15},{"name":1712,"slug":1713,"type":15},"Data Engineering","data-engineering",{"name":17,"slug":17,"type":15},{"name":1700,"slug":1701,"type":15},"2026-07-18T05:12:20.387564",{"slug":1718,"name":1718,"fn":1719,"description":1720,"org":1721,"tags":1722,"stars":1683,"repoUrl":1684,"updatedAt":1730},"configuring-dbt-mcp-server","configure dbt MCP server","Generates MCP server configuration JSON, resolves authentication setup, and validates server connectivity for dbt. Use when setting up, configuring, or troubleshooting the dbt MCP server for AI tools like Claude Desktop, Claude Code, Cursor, or VS Code.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1723,1726,1727],{"name":1724,"slug":1725,"type":15},"Agent Context","agent-context",{"name":17,"slug":17,"type":15},{"name":1728,"slug":1729,"type":15},"MCP","mcp","2026-04-06T18:09:12.757804",{"slug":1732,"name":1732,"fn":1733,"description":1734,"org":1735,"tags":1736,"stars":1683,"repoUrl":1684,"updatedAt":1747},"creating-mermaid-dbt-dag","generate Mermaid diagrams of dbt model lineage","Generates a Mermaid flowchart diagram of dbt model lineage using MCP tools, manifest.json, or direct code parsing as fallbacks. Use when visualizing dbt model lineage and dependencies as a Mermaid diagram in markdown format.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1737,1740,1741,1744],{"name":1738,"slug":1739,"type":15},"Data Pipeline","data-pipeline",{"name":17,"slug":17,"type":15},{"name":1742,"slug":1743,"type":15},"Diagrams","diagrams",{"name":1745,"slug":1746,"type":15},"Documentation","documentation","2026-04-06T18:09:15.270247",{"slug":1749,"name":1749,"fn":1750,"description":1751,"org":1752,"tags":1753,"stars":1683,"repoUrl":1684,"updatedAt":1759},"fetching-dbt-docs","search dbt documentation","Retrieves and searches dbt documentation pages in LLM-friendly markdown format. Use when fetching dbt documentation, looking up dbt features, or answering questions about dbt Cloud, dbt Core, or the dbt Semantic Layer.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1754,1755,1756],{"name":17,"slug":17,"type":15},{"name":1745,"slug":1746,"type":15},{"name":1757,"slug":1758,"type":15},"Reference","reference","2026-04-06T18:09:06.36975",{"slug":1761,"name":1761,"fn":1762,"description":1763,"org":1764,"tags":1765,"stars":1683,"repoUrl":1684,"updatedAt":1774},"migrating-dbt-core-to-fusion","triage dbt-core to Fusion migration errors","Use when a user needs help triaging dbt-core to Fusion migration errors. Runs dbt-autofix first, then classifies remaining errors into actionable categories (auto-fixable, guided fixes, needs input, blocked).",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1766,1767,1768,1771],{"name":1712,"slug":1713,"type":15},{"name":17,"slug":17,"type":15},{"name":1769,"slug":1770,"type":15},"Migration","migration",{"name":1772,"slug":1773,"type":15},"Triage","triage","2026-04-06T18:09:01.250175",{"slug":1776,"name":1776,"fn":1777,"description":1778,"org":1779,"tags":1780,"stars":1683,"repoUrl":1684,"updatedAt":1786},"migrating-dbt-project-across-platforms","migrate dbt projects across data platforms","Use when migrating a dbt project from one data platform or data warehouse to another (e.g., Snowflake to Databricks, Databricks to Snowflake) using dbt Fusion's real-time compilation to identify and fix SQL dialect differences.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1781,1782,1783,1784,1785],{"name":1712,"slug":1713,"type":15},{"name":13,"slug":14,"type":15},{"name":17,"slug":17,"type":15},{"name":1769,"slug":1770,"type":15},{"name":19,"slug":20,"type":15},"2026-04-06T18:09:02.513828",{"slug":1788,"name":1788,"fn":1789,"description":1790,"org":1791,"tags":1792,"stars":1683,"repoUrl":1684,"updatedAt":1798},"running-dbt-commands","run dbt CLI commands","Formats and executes dbt CLI commands, selects the correct dbt executable, and structures command parameters. Use when running models, tests, builds, compiles, or show queries via dbt CLI. Use when unsure which dbt executable to use or how to format command parameters.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1793,1796,1797],{"name":1794,"slug":1795,"type":15},"CLI","cli",{"name":1712,"slug":1713,"type":15},{"name":17,"slug":17,"type":15},"2026-04-06T18:09:03.791122",{"slug":1800,"name":1800,"fn":1801,"description":1802,"org":1803,"tags":1804,"stars":1683,"repoUrl":1684,"updatedAt":1810},"troubleshooting-dbt-job-errors","troubleshoot dbt job errors","Diagnoses dbt Cloud\u002Fplatform job failures by analyzing run logs, querying the Admin API, reviewing git history, and investigating data issues. Use when a dbt Cloud\u002Fplatform job fails and you need to diagnose the root cause, especially when error messages are unclear or when intermittent failures occur. Do not use for local dbt development errors.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1805,1806,1807],{"name":1738,"slug":1739,"type":15},{"name":17,"slug":17,"type":15},{"name":1808,"slug":1809,"type":15},"Debugging","debugging","2026-04-06T18:09:05.065669",{"slug":1812,"name":1812,"fn":1813,"description":1814,"org":1815,"tags":1816,"stars":1683,"repoUrl":1684,"updatedAt":1821},"using-dbt-for-analytics-engineering","build dbt models and tests","Builds and modifies dbt models, writes SQL transformations using ref() and source(), creates tests, and validates results with dbt show. Use when doing any dbt work - building or modifying models, debugging errors, exploring unfamiliar data sources, writing tests, or evaluating impact of changes.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1817,1818,1819,1820],{"name":1693,"slug":1694,"type":15},{"name":1712,"slug":1713,"type":15},{"name":17,"slug":17,"type":15},{"name":19,"slug":20,"type":15},"2026-04-06T18:09:11.455851",{"slug":1823,"name":1823,"fn":1824,"description":1825,"org":1826,"tags":1827,"stars":1683,"repoUrl":1684,"updatedAt":1834},"using-dbt-state","configure and optimize dbt state","Use when a user is enabling, configuring, optimizing, or debugging dbt State (the server-backed reuse mechanism that clones or skips nodes instead of rebuilding them). Use when they conflate dbt State with the `state:modified` selector or `--state` deferral. Use when asked about models rebuilding unexpectedly, views with `select *` rebuilding, volatile SQL (`current_timestamp()`, `random()`) rebuilding or not, cross-developer cloning, lag_tolerance.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1828,1829,1830,1831],{"name":1712,"slug":1713,"type":15},{"name":1738,"slug":1739,"type":15},{"name":17,"slug":17,"type":15},{"name":1832,"slug":1833,"type":15},"Performance","performance","2026-06-25T07:12:16.623154",16]