From 50b85a0b0184730177705e1625c839dde1d3a64f Mon Sep 17 00:00:00 2001 From: Chenyu Li Date: Wed, 24 Jan 2024 15:43:53 -0800 Subject: [PATCH] fix retry as CLI (#9443) --- .changes/unreleased/Fixes-20240124-142522.yaml | 6 ++++++ core/dbt/cli/main.py | 3 +-- core/dbt/task/retry.py | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 .changes/unreleased/Fixes-20240124-142522.yaml diff --git a/.changes/unreleased/Fixes-20240124-142522.yaml b/.changes/unreleased/Fixes-20240124-142522.yaml new file mode 100644 index 00000000000..40a8b1a6aea --- /dev/null +++ b/.changes/unreleased/Fixes-20240124-142522.yaml @@ -0,0 +1,6 @@ +kind: Fixes +body: Fix retry command run from CLI +time: 2024-01-24T14:25:22.846199-08:00 +custom: + Author: ChenyuLInx + Issue: "9444" diff --git a/core/dbt/cli/main.py b/core/dbt/cli/main.py index ad2fbf61a77..924f0e397bb 100644 --- a/core/dbt/cli/main.py +++ b/core/dbt/cli/main.py @@ -602,13 +602,12 @@ def run(ctx, **kwargs): @requires.profile @requires.project @requires.runtime_config -@requires.manifest def retry(ctx, **kwargs): """Retry the nodes that failed in the previous run.""" + # Retry will parse manifest inside the task after we consolidate the flags task = RetryTask( ctx.obj["flags"], ctx.obj["runtime_config"], - ctx.obj["manifest"], ) results = task.run() diff --git a/core/dbt/task/retry.py b/core/dbt/task/retry.py index 717f4f90ec9..9aadf9ead97 100644 --- a/core/dbt/task/retry.py +++ b/core/dbt/task/retry.py @@ -63,7 +63,7 @@ class RetryTask(ConfiguredTask): - def __init__(self, args, config, manifest) -> None: + def __init__(self, args, config) -> None: # load previous run results state_path = args.state or config.target_path self.previous_results = load_result_state(