-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CT-3401] [Bug] dbt retry fails to apply --full-refresh to downstream models and vars #9112
Comments
This also seems to apply to vars passed in with |
Notes from refinement:
|
Silly repro case: select {{ var('something') }} as {{ flags.FULL_REFRESH }}
After a bit of poking, I'm seeing the issue crop up here, when we initialize dbt-core/core/dbt/task/retry.py Lines 108 to 110 in 1c9cec1
ipdb> combined_args['full_refresh']
True
ipdb> combined_args['vars']
{'something': 'else'}
ipdb> cli_command
<Command.RUN: 'run'>
ipdb> retry_flags
Flags()
ipdb> retry_flags.full_refresh
False
ipdb> retry_flags.vars
{'something': 'else'} The
|
Discussed offline with @jtcohen6, comment doesn't apply but leaving for posterity.
dbt-core/core/dbt/task/retry.py Lines 22 to 31 in 3f7f7de
|
@aranke In case you didn't see the notes from refinement - "We decided that you should be able to override the path configs the the retry command. For every other flag though, whatever was the setting for the original invocation, use the same flags for retry." This issue is about both |
From live discussion: Let's investigate the fix, and backport to v1.7 only. Rationale: v1.6 is now under "critical" support, and it is very much still usable, just with this known bug. Users will be able to upgrade to v1.7 for the fix. |
Is this a new bug in dbt-core?
Current Behavior
dbt retry
fails to pass--full-refresh
flag from the original invocation to all models in the retry DAG after the first oneHaven't used
dbt retry
in earlier versions so unable to say if this is a regression or notExpected Behavior
dbt retry
creates a new DAG starting from the point of failure, continuing with everything downstreamAll flags/args passed in the previous invocation should be applied to all models in the retry DAG
Steps To Reproduce
Create 2 incremental models. The second model should reference the first. In both models log the value of
is_incremental
with{{ log('is_incremental is' ~ is_incremental(), info=True)}}
Create a compilation error in model 1 and invoke
dbt run --select +model_2 --full-refresh
This should set
is_incremental()
toFalse
anddbt retry
Model one will now run, logging
is_incremental
=False
(expected behaviour)Model two will now run, logging
is_incremental
=True
(not desired behaviour)Relevant log output
Environment
Which database adapter are you using with dbt?
other (mention it in "Additional Context")
Additional Context
Using
dbt-trino 1.6.0
The text was updated successfully, but these errors were encountered: