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

bugfix: target paths #331

Merged
merged 2 commits into from
Mar 15, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions dbt/compilation.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ def __write(self, build_filepath, payload):

dbt.compat.write_file(target_path, payload)

return target_path

def __model_config(self, model, linker):
def do_config(*args, **kwargs):
return ''
Expand Down Expand Up @@ -390,15 +392,18 @@ def compile_nodes(self, linker, nodes, macro_generator):
injected_node['wrapped_sql'] = wrapped_stmt
wrapped_nodes[name] = injected_node

build_path = os.path.join('build', injected_node.get('path'))
build_path = os.path.join('build',
injected_node.get('package_name'),
injected_node.get('path'))

if injected_node.get('resource_type') in (NodeType.Model,
NodeType.Analysis,
NodeType.Test) and \
get_materialization(injected_node) != 'ephemeral':
self.__write(build_path, injected_node.get('wrapped_sql'))
written_path = self.__write(
build_path, injected_node.get('wrapped_sql'))
written_nodes.append(injected_node)
injected_node['build_path'] = build_path
injected_node['build_path'] = written_path

linker.add_node(injected_node.get('unique_id'))
project = all_projects[injected_node.get('package_name')]
Expand Down