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

add a formal search order for materializations, tests (#1962) #1976

Merged
merged 1 commit into from
Dec 9, 2019

Conversation

beckjake
Copy link
Contributor

@beckjake beckjake commented Dec 4, 2019

Fixes #1962

I've added some integration tests - not sure if there should be more covering the other possible behaviors, but I think this is reasonably comprehensive.

@cla-bot cla-bot bot added the cla:yes label Dec 4, 2019
@beckjake beckjake force-pushed the fix/override-materializations branch from 93bc104 to 1b0d635 Compare December 4, 2019 17:45
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.

This looks really great! I gave it a spin locally to confirm - looks like everything is working really well. I'll update the docs to expand on the information about materialization precedence. Nice work :)

locality: Locality
macro: ParsedMacro

def __eq__(self, other):
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this also check the name of the materialization? Or is that better handled in the caller?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Two candidates that are "the same" could have different names - in fact if they have different specificity they will by definition have different names.

Whenever we are comparing candidates, we know they're all the same base macro name in the end - that's why we're sorting them, to decide which of the matching macros to pick. So we can just ignore that here, the type only exists for list.sort().

Copy link
Contributor

Choose a reason for hiding this comment

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

makes sense to me! ship it :)

@beckjake beckjake merged commit 2dd604b into dev/0.15.1 Dec 9, 2019
@beckjake beckjake deleted the fix/override-materializations branch December 9, 2019 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot override dbt default materializations
2 participants