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

Use root project instead of package project in context generator #538

Merged
merged 1 commit into from
Sep 26, 2017

Conversation

drewbanin
Copy link
Contributor

@drewbanin drewbanin commented Sep 25, 2017

This bug (introduced by custom schemas) caused models defined in dependency projects to use the schema associated with the default target for a profile.

So,

$ dbt run --target prod

would use analytics for models in the root project, while it would use eg. dbt_dbanin for models in dependency packages.

Part of the problem is this line here

@cmcarthur do you think this is a sufficient fix? Kind of a tricky bug here

@@ -218,7 +218,7 @@ def parse_node(node, node_path, root_project_config, package_project_config,
config_dict.update(config.config)
node['config'] = config_dict

context = dbt.context.parser.generate(node, package_project_config,
context = dbt.context.parser.generate(node, root_project_config,
Copy link
Member

Choose a reason for hiding this comment

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

ok, so in dbt.context.common.generate, we only want the root project config. can you also double check:

dbt/context/runtime.py line 94
dbt/node_runners.py line 377

if you do that then this is approved

@drewbanin drewbanin merged commit c02caa0 into development Sep 26, 2017
@drewbanin drewbanin deleted the fix/wrong-project-in-context branch September 26, 2017 19:08
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