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

populate the cache on compile, too (#1705) #1737

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 4 additions & 0 deletions core/dbt/task/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ class CompileTask(GraphRunnableTask):
def raise_on_first_error(self):
return True

def before_run(self, adapter, selected_uids):
with adapter.connection_named('master'):
self.populate_adapter_cache(adapter)

def build_query(self):
return {
"include": self.args.models,
Expand Down
3 changes: 0 additions & 3 deletions core/dbt/task/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ def __init__(self, args, config):
def raise_on_first_error(self):
return False

def populate_adapter_cache(self, adapter):
adapter.set_relations_cache(self.manifest)

def get_hook_sql(self, adapter, hook, idx, num_hooks, extra_context):
compiled = compile_node(adapter, self.config, hook, self.manifest,
extra_context)
Expand Down
3 changes: 3 additions & 0 deletions core/dbt/task/runnable.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ def _runtime_initialize(self):
self.load_manifest()
self.compile_manifest()

def populate_adapter_cache(self, adapter):
adapter.set_relations_cache(self.manifest)


class GraphRunnableTask(ManifestTask):
def __init__(self, args, config):
Expand Down