Skip to content
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

[Feature] When a test fails, dbt retry should also rebuild the model(s) against which the test failed instead of re-running the same doomed test against the original model #10164

Open
3 tasks done
joellabes opened this issue May 16, 2024 · 1 comment
Labels
dbt tests Issues related to built-in dbt testing functionality enhancement New feature or request triage

Comments

@joellabes
Copy link
Contributor

Is this your first time submitting a feature request?

  • I have read the expectations for open source contributors
  • I have searched the existing issues, and I could not find an existing issue for this feature
  • I am requesting a straightforward extension of existing dbt functionality, rather than a Big Idea better suited to a discussion

Describe the feature

Given:

--models/model_a.sql
select 1 as id
union all 
select null as id
# models/model_a.yml
models: 
  - name: model_a
    columns: 
      - name: id
        tests: 
          - not_null
  1. Run dbt build - fails because id has a null record
  2. Delete the lines adding null to model_a
  3. Run dbt retry --state yada/yada
  4. Note that the build still fails because id has a null record, because only the test is re-run.

Instead, dbt retry should re-run the model that is attached to the test.

Today, retry only works for transient errors (e.g. a relationship test failing because fivetran hasn't finished on both sides of the PK/FK divide) or errors that cause a SQL failure in the model. If tests pick up a logic mistake, then dbt retry doesn't work for mopping up afterwards.

Describe alternatives you've considered

rolling my own with something like dbt build -s 1+status:error+ (freehanded, but you get my point even if it's not strictly correct syntax)

Who will this benefit?

No response

Are you interested in contributing this feature?

Nah

Anything else?

Instigating feedback from the Cloud feedback form: https://dbt-labs.productboard.com/insights/all-notes/notes/39794606

I have seen multiple other threads about this too though so not an isolated incident.

@joellabes joellabes added enhancement New feature or request triage labels May 16, 2024
@dbeatty10 dbeatty10 added the dbt tests Issues related to built-in dbt testing functionality label May 16, 2024
@dave-connors-3
Copy link
Contributor

This was requested in a customer conversation yesterday, and is an all around no brainer of an enhancement IMHO!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dbt tests Issues related to built-in dbt testing functionality enhancement New feature or request triage
Projects
None yet
Development

No branches or pull requests

3 participants