Skip to content

Commit

Permalink
only load hooks and archives once (#540)
Browse files Browse the repository at this point in the history
  • Loading branch information
drewbanin authored Sep 29, 2017
1 parent c395b47 commit 9f365eb
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions dbt/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,16 @@ def load_project(cls, root_project, all_projects, project, project_name,
macros=macros)


# ArchiveLoader and RunHookLoader operate on configs, so we just need to run
# them both once, not for each project
class ArchiveLoader(ResourceLoader):

@classmethod
def load_project(cls, root_project, all_projects, project, project_name,
macros):
def load_all(cls, root_project, all_projects, macros=None):
return cls.load_project(root_project, all_projects, macros)

@classmethod
def load_project(cls, root_project, all_projects, macros):
return dbt.parser.parse_archives_from_projects(root_project,
all_projects,
macros)
Expand All @@ -143,8 +148,11 @@ def load_project(cls, root_project, all_projects, project, project_name,
class RunHookLoader(ResourceLoader):

@classmethod
def load_project(cls, root_project, all_projects, project, project_name,
macros):
def load_all(cls, root_project, all_projects, macros=None):
return cls.load_project(root_project, all_projects, macros)

@classmethod
def load_project(cls, root_project, all_projects, macros):
return dbt.parser.load_and_parse_run_hooks(root_project, all_projects,
macros)

Expand Down

0 comments on commit 9f365eb

Please sign in to comment.