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

[Bug] Restore v1.7 behavior for --defer + --favor-state when selecting interdependent resources #10107

Closed
2 tasks done
jtcohen6 opened this issue May 8, 2024 · 0 comments · Fixed by #10108
Closed
2 tasks done
Assignees
Labels
backport 1.8.latest bug Something isn't working pre-regression Regression not yet in a stable release

Comments

@jtcohen6
Copy link
Contributor

jtcohen6 commented May 8, 2024

Is this a new bug in dbt-core?

  • I believe this is a new bug in dbt-core
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

Given:

model_a ----\
             \
              --> model_c 
             /
model_b ----/

After the recent refactors to deferral, dbt run --select model_b model_c --favor-state would yield compiled code such that:

-- target/compiled/model_c.sql
select * from prod.model_a
union all
select * from prod.model_b

Expected Behavior

In v1.7 and previous versions, because model_b is also selected in the current run (even though we are using --favor-state overall), the compiled code for model_c should use the prod target for model_a (regardless of whether it exists in the dev schema) but always the dev target for model_b:

-- target/compiled/model_c.sql
select * from prod.model_a
union all
select * from dev.model_b

Steps To Reproduce

  1. Define model_a, model_b, model_c as shown
  2. dbt run --target prod
  3. mv target/manifest.json state/
  4. dbt run --select model_b model_c --favor-state

Relevant log output

No response

Environment

dbt: 1.8.0rc1 / main

Which database adapter are you using with dbt?

No response

Additional Context

This has not been reported by any users/customers, I just realized it while writing this comment:

@jtcohen6 jtcohen6 added bug Something isn't working pre-regression Regression not yet in a stable release backport 1.8.latest labels May 8, 2024
@jtcohen6 jtcohen6 self-assigned this May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 1.8.latest bug Something isn't working pre-regression Regression not yet in a stable release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant