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

fix overriding a disabled model in a package #391

Merged
merged 6 commits into from
Apr 21, 2017

Conversation

cmcarthur
Copy link
Member

@cmcarthur cmcarthur commented Apr 20, 2017

@drewbanin this adds a test & fix for overriding a disabled model from a package in the current project

@cmcarthur cmcarthur requested a review from drewbanin April 20, 2017 14:34
dbt/parser.py Outdated
flat_graph,
target_model_name,
target_model_package)
# first, look for a model that matches the current
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cmcarthur I'm kind of surprised this works! I think the ref resolution order we want is:

  1. "top-level" project
  2. The node's package
  3. All packages

Does that seem right to you?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That precedence seems sane to me. I'll update this. The use case here is that a model in a package uses {{ref('dep')}} and then you can override dep in your project, right?

This also doesn't work quite right as I think more about it -- what you want is to continue to the next option if the one you found is disabled. @drewbanin if you have time this afternoon let's discuss

Copy link
Contributor

@drewbanin drewbanin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Great work, approved

Connor McArthur added 2 commits April 20, 2017 19:48
@cmcarthur cmcarthur merged commit 29871fc into development Apr 21, 2017
@cmcarthur cmcarthur deleted the fix/override-disabled branch April 21, 2017 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants