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

[CT-470] [Feature] Add option for --defer to favor using --state node even if node exists in current target #5016

Closed
1 task done
daniel-murray opened this issue Apr 8, 2022 · 6 comments · Fixed by #5859
Labels
enhancement New feature or request
Milestone

Comments

@daniel-murray
Copy link

Is there an existing feature request for this?

  • I have searched the existing issues

Describe the Feature

This is the current behaviour of the --defer flag:

When the --defer flag is provided, dbt will resolve ref calls differently depending on two criteria:
Is the referenced node included in the model selection criteria of the current run?
Does the reference node exist as a database object in the current environment?

The first criterion is always valid. However, it would be useful if the second criterion was optional.

This is because we re-use the same development schemas for multiple features. Therefore you could accidentally use an old version of a node you created for a different feature while using the --defer flag.

Describe alternatives you've considered

  1. Drop all tables in our development schemas after each feature is complete.
    It's not practical to delete all tables after each feature due to ongoing QA for old features.

  2. Making --favor-state a completely different feature to --defer
    The code change is minimal to implement this feature if used in conjunction with the code already created for --defer.

Who will this benefit?

Anyone using the --defer flag so they can have more control over its behaviour.

Are you interested in contributing this feature?

Yes would love to! We have a PR ready and tested.

Anything else?

No response

@daniel-murray daniel-murray added enhancement New feature or request triage labels Apr 8, 2022
@github-actions github-actions bot changed the title [Feature] Add option for --defer to favor using --state node even if node exists in current target [CT-470] [Feature] Add option for --defer to favor using --state node even if node exists in current target Apr 8, 2022
@daniel-murray daniel-murray mentioned this issue Apr 8, 2022
4 tasks
@daniel-murray
Copy link
Author

PR here of the proposed changes

@iknox-fa
Copy link
Contributor

Hi @daniel-murray, thanks so much for the contribution! I'll give this PR a review shortly, but in the meantime can you please fill out our CLA so we can get this merged in?

@daniel-murray
Copy link
Author

Hi @iknox-fa no problem at all! Thank you very much. We're waiting on our legal team here to review the CLA and unfortunately, they've asked us to wait until next week. I'll update here as soon as they do.

@NiallRees
Copy link
Contributor

Just adding a big plus one to getting this in! Any update @daniel-murray ?

@github-actions
Copy link
Contributor

github-actions bot commented Nov 1, 2022

This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please remove the stale label or comment on the issue, or it will be closed in 7 days.

@github-actions github-actions bot added the stale Issues that have gone stale label Nov 1, 2022
@NiallRees
Copy link
Contributor

Still want this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants