From 412973ca471598ddd9df47dbf93debe9c95024d1 Mon Sep 17 00:00:00 2001 From: Matt Shaver <60105315+matthewshaver@users.noreply.github.com> Date: Tue, 29 Aug 2023 17:26:08 -0400 Subject: [PATCH 1/8] Error handling for dbt retry --- website/docs/reference/commands/retry.md | 76 ++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/website/docs/reference/commands/retry.md b/website/docs/reference/commands/retry.md index 8f5c617ef80..987c12a551a 100644 --- a/website/docs/reference/commands/retry.md +++ b/website/docs/reference/commands/retry.md @@ -28,3 +28,79 @@ Retry works with the following commands: `dbt retry` reuses the [selectors](/reference/node-selection/yaml-selectors) from the previously executed command. + +If you run `dbt retry` after successfully executing `dbt run`, you'll get the following results. + +``` +Running with dbt=1.6.1 +Registered adapter: duckdb=1.6.0 +Found 5 models, 3 seeds, 20 tests, 0 sources, 0 exposures, 0 metrics, 348 macros, 0 groups, 0 semantic models + +Nothing to do. Try checking your model configs and model specification args +``` + +In a scenario where `dbt run` has failed due to a syntax error in a model: + +``` +Running with dbt=1.6.1 +Registered adapter: duckdb=1.6.0 +Found 5 models, 3 seeds, 20 tests, 0 sources, 0 exposures, 0 metrics, 348 macros, 0 groups, 0 semantic models + +Concurrency: 24 threads (target='dev') + +1 of 5 START sql view model main.stg_customers ................................. [RUN] +2 of 5 START sql view model main.stg_orders .................................... [RUN] +3 of 5 START sql view model main.stg_payments .................................. [RUN] +1 of 5 OK created sql view model main.stg_customers ............................ [OK in 0.06s] +2 of 5 OK created sql view model main.stg_orders ............................... [OK in 0.06s] +3 of 5 OK created sql view model main.stg_payments ............................. [OK in 0.07s] +4 of 5 START sql table model main.customers .................................... [RUN] +5 of 5 START sql table model main.orders ....................................... [RUN] +4 of 5 ERROR creating sql table model main.customers ........................... [ERROR in 0.03s] +5 of 5 OK created sql table model main.orders .................................. [OK in 0.04s] + +Finished running 3 view models, 2 table models in 0 hours 0 minutes and 0.15 seconds (0.15s). + +Completed with 1 error and 0 warnings: + +Runtime Error in model customers (models/customers.sql) + Parser Error: syntax error at or near "selct" + +Done. PASS=4 WARN=0 ERROR=1 SKIP=0 TOTAL=5 +``` + + +Executing `dbt retry` without fixing the error(s) will result in another failed run: +``` +Running with dbt=1.6.1 +Registered adapter: duckdb=1.6.0 +Found 5 models, 3 seeds, 20 tests, 0 sources, 0 exposures, 0 metrics, 348 macros, 0 groups, 0 semantic models + +Concurrency: 24 threads (target='dev') + +1 of 1 START sql table model main.customers .................................... [RUN] +1 of 1 ERROR creating sql table model main.customers ........................... [ERROR in 0.03s] + +Done. PASS=4 WARN=0 ERROR=1 SKIP=0 TOTAL=5 +``` + +Executing `dbt retry` after a failed run, but correcting the issue, will result in a completed run: + +``` +Running with dbt=1.6.1 +Registered adapter: duckdb=1.6.0 +Found 5 models, 3 seeds, 20 tests, 0 sources, 0 exposures, 0 metrics, 348 macros, 0 groups, 0 semantic models + +Concurrency: 24 threads (target='dev') + +1 of 1 START sql table model main.customers .................................... [RUN] +1 of 1 OK created sql table model main.customers ............................... [OK in 0.05s] + +Finished running 1 table model in 0 hours 0 minutes and 0.09 seconds (0.09s). + +Completed successfully + +Done. PASS=1 WARN=0 ERROR=0 SKIP=0 TOTAL=1 +``` + +In each scenario `dbt retry` picks up from the error rather than running all of the upstream dependencies again. \ No newline at end of file From 9f01ca3555b6715f56f705223145c660c1db1ee0 Mon Sep 17 00:00:00 2001 From: Matt Shaver <60105315+matthewshaver@users.noreply.github.com> Date: Tue, 29 Aug 2023 17:30:56 -0400 Subject: [PATCH 2/8] Update website/docs/reference/commands/retry.md --- website/docs/reference/commands/retry.md | 1 - 1 file changed, 1 deletion(-) diff --git a/website/docs/reference/commands/retry.md b/website/docs/reference/commands/retry.md index 987c12a551a..d65a5a04bf7 100644 --- a/website/docs/reference/commands/retry.md +++ b/website/docs/reference/commands/retry.md @@ -71,7 +71,6 @@ Done. PASS=4 WARN=0 ERROR=1 SKIP=0 TOTAL=5 Executing `dbt retry` without fixing the error(s) will result in another failed run: -``` Running with dbt=1.6.1 Registered adapter: duckdb=1.6.0 Found 5 models, 3 seeds, 20 tests, 0 sources, 0 exposures, 0 metrics, 348 macros, 0 groups, 0 semantic models From a112953417bf450a9bdfc54accb97c2a4742a124 Mon Sep 17 00:00:00 2001 From: Matt Shaver <60105315+matthewshaver@users.noreply.github.com> Date: Tue, 29 Aug 2023 17:31:02 -0400 Subject: [PATCH 3/8] Update website/docs/reference/commands/retry.md --- website/docs/reference/commands/retry.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/reference/commands/retry.md b/website/docs/reference/commands/retry.md index d65a5a04bf7..03503741b95 100644 --- a/website/docs/reference/commands/retry.md +++ b/website/docs/reference/commands/retry.md @@ -29,7 +29,7 @@ Retry works with the following commands: `dbt retry` reuses the [selectors](/reference/node-selection/yaml-selectors) from the previously executed command. -If you run `dbt retry` after successfully executing `dbt run`, you'll get the following results. +Executing `dbt retry` after a successful `dbt run` will yield the following results: ``` Running with dbt=1.6.1 From e146d59295c44185d6ccfddcee63dd8fc49dc096 Mon Sep 17 00:00:00 2001 From: Matt Shaver <60105315+matthewshaver@users.noreply.github.com> Date: Tue, 29 Aug 2023 17:32:16 -0400 Subject: [PATCH 4/8] Update retry.md --- website/docs/reference/commands/retry.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/website/docs/reference/commands/retry.md b/website/docs/reference/commands/retry.md index 03503741b95..71172ce0ca1 100644 --- a/website/docs/reference/commands/retry.md +++ b/website/docs/reference/commands/retry.md @@ -71,6 +71,8 @@ Done. PASS=4 WARN=0 ERROR=1 SKIP=0 TOTAL=5 Executing `dbt retry` without fixing the error(s) will result in another failed run: + +``` Running with dbt=1.6.1 Registered adapter: duckdb=1.6.0 Found 5 models, 3 seeds, 20 tests, 0 sources, 0 exposures, 0 metrics, 348 macros, 0 groups, 0 semantic models @@ -102,4 +104,4 @@ Completed successfully Done. PASS=1 WARN=0 ERROR=0 SKIP=0 TOTAL=1 ``` -In each scenario `dbt retry` picks up from the error rather than running all of the upstream dependencies again. \ No newline at end of file +In each scenario `dbt retry` picks up from the error rather than running all of the upstream dependencies again. From e7d4b7b8153714fb4cffc621272720377bd930a8 Mon Sep 17 00:00:00 2001 From: Matt Shaver <60105315+matthewshaver@users.noreply.github.com> Date: Tue, 29 Aug 2023 17:44:17 -0400 Subject: [PATCH 5/8] Empty-Commit From 72da3f07a85256babe229882fccde4739fc07e06 Mon Sep 17 00:00:00 2001 From: Matt Shaver <60105315+matthewshaver@users.noreply.github.com> Date: Wed, 30 Aug 2023 14:08:47 -0400 Subject: [PATCH 6/8] Apply suggestions from code review Co-authored-by: Ly Nguyen <107218380+nghi-ly@users.noreply.github.com> --- website/docs/reference/commands/retry.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/website/docs/reference/commands/retry.md b/website/docs/reference/commands/retry.md index 71172ce0ca1..5e3871d1684 100644 --- a/website/docs/reference/commands/retry.md +++ b/website/docs/reference/commands/retry.md @@ -31,7 +31,7 @@ Retry works with the following commands: Executing `dbt retry` after a successful `dbt run` will yield the following results: -``` +```shell Running with dbt=1.6.1 Registered adapter: duckdb=1.6.0 Found 5 models, 3 seeds, 20 tests, 0 sources, 0 exposures, 0 metrics, 348 macros, 0 groups, 0 semantic models @@ -39,9 +39,9 @@ Found 5 models, 3 seeds, 20 tests, 0 sources, 0 exposures, 0 metrics, 348 macros Nothing to do. Try checking your model configs and model specification args ``` -In a scenario where `dbt run` has failed due to a syntax error in a model: +Example of when `dbt run` encounters a syntax error in a model: -``` +```shell Running with dbt=1.6.1 Registered adapter: duckdb=1.6.0 Found 5 models, 3 seeds, 20 tests, 0 sources, 0 exposures, 0 metrics, 348 macros, 0 groups, 0 semantic models @@ -70,9 +70,9 @@ Done. PASS=4 WARN=0 ERROR=1 SKIP=0 TOTAL=5 ``` -Executing `dbt retry` without fixing the error(s) will result in another failed run: +Example of a subsequent failed `dbt retry` run without fixing the error(s): -``` +```shell Running with dbt=1.6.1 Registered adapter: duckdb=1.6.0 Found 5 models, 3 seeds, 20 tests, 0 sources, 0 exposures, 0 metrics, 348 macros, 0 groups, 0 semantic models @@ -85,9 +85,9 @@ Concurrency: 24 threads (target='dev') Done. PASS=4 WARN=0 ERROR=1 SKIP=0 TOTAL=5 ``` -Executing `dbt retry` after a failed run, but correcting the issue, will result in a completed run: +Example of a successful `dbt retry` run after fixing error(s): -``` +```shell Running with dbt=1.6.1 Registered adapter: duckdb=1.6.0 Found 5 models, 3 seeds, 20 tests, 0 sources, 0 exposures, 0 metrics, 348 macros, 0 groups, 0 semantic models From 63af107bf18429fa4357a732f986c9ec3d06684a Mon Sep 17 00:00:00 2001 From: Matt Shaver <60105315+matthewshaver@users.noreply.github.com> Date: Wed, 30 Aug 2023 14:08:54 -0400 Subject: [PATCH 7/8] Apply suggestions from code review Co-authored-by: Ly Nguyen <107218380+nghi-ly@users.noreply.github.com> --- website/docs/reference/commands/retry.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/reference/commands/retry.md b/website/docs/reference/commands/retry.md index 5e3871d1684..d494a46cf1f 100644 --- a/website/docs/reference/commands/retry.md +++ b/website/docs/reference/commands/retry.md @@ -29,7 +29,7 @@ Retry works with the following commands: `dbt retry` reuses the [selectors](/reference/node-selection/yaml-selectors) from the previously executed command. -Executing `dbt retry` after a successful `dbt run` will yield the following results: +Example results of executing `dbt retry` after a successful `dbt run`: ```shell Running with dbt=1.6.1 From 2693862825f158c2916f6ba3a535e661f8d70607 Mon Sep 17 00:00:00 2001 From: Matt Shaver <60105315+matthewshaver@users.noreply.github.com> Date: Wed, 30 Aug 2023 14:23:34 -0400 Subject: [PATCH 8/8] Empty-Commit