def dbt_manifest(self): """Loads the dbt manifest.""" # Identity function used for macro hooks def identity(x): return x # Set dbt not to run tracking. We don't load # a dull project and so some tracking routines # may fail. from dbt.tracking import do_not_track do_not_track() if "0.17" in self.dbt_version: from dbt.parser.manifest import ( load_internal_manifest as load_macro_manifest, load_manifest, ) else: from dbt.parser.manifest import ( load_macro_manifest, load_manifest, ) load_macro_manifest = partial(load_macro_manifest, macro_hook=identity) dbt_macros_manifest = load_macro_manifest(self.dbt_config) self.dbt_manifest = load_manifest( self.dbt_config, dbt_macros_manifest, macro_hook=identity ) return self.dbt_manifest
def dbt_manifest(self): """Loads the dbt manifest.""" # Identity function used for macro hooks def identity(x): return x if "0.17" in self.dbt_version: from dbt.parser.manifest import ( load_internal_manifest as load_macro_manifest, load_manifest, ) else: from dbt.parser.manifest import ( load_macro_manifest, load_manifest, ) load_macro_manifest = partial(load_macro_manifest, macro_hook=identity) dbt_macros_manifest = load_macro_manifest(self.dbt_config) self.dbt_manifest = load_manifest(self.dbt_config, dbt_macros_manifest, macro_hook=identity) return self.dbt_manifest
def load_macro_manifest(self) -> MacroManifest: if self._macro_manifest_lazy is None: # avoid a circular import from dbt.parser.manifest import load_macro_manifest manifest = load_macro_manifest(self.config, self.connections.set_query_header) self._macro_manifest_lazy = manifest return self._macro_manifest_lazy