def _get_exec_node(self): if self.manifest is None: raise InternalException('manifest not set in _get_exec_node') results = ParseResult.rpc() macro_overrides = {} macros = self.args.macros sql, macros = self._extract_request_data(self.args.sql) if macros: macro_parser = RPCMacroParser(results, self.config) for node in macro_parser.parse_remote(macros): macro_overrides[node.unique_id] = node self.manifest.macros.update(macro_overrides) rpc_parser = RPCCallParser( results=results, project=self.config, root_project=self.config, macro_manifest=self.manifest, ) rpc_node = rpc_parser.parse_remote(sql, self.args.name) add_new_refs(manifest=self.manifest, config=self.config, node=rpc_node, macros=macro_overrides) # don't write our new, weird manifest! self.linker = compile_manifest(self.config, self.manifest, write=False) self._compile_ancestors(rpc_node.unique_id) return rpc_node
def _runtime_initialize(self): self.manifest = load_manifest(self.config) self.linker = compile_manifest(self.config, self.manifest) selector = dbt.graph.selector.NodeSelector(self.linker, self.manifest) selected_nodes = selector.select(self.build_query()) self.job_queue = self.linker.as_graph_queue(self.manifest, selected_nodes) # we use this a couple times. order does not matter. self._flattened_nodes = [ self.manifest.nodes[uid] for uid in selected_nodes ] self.num_nodes = len([ n for n in self._flattened_nodes if not n.is_ephemeral_model ])
def compile_manifest(self): if self.manifest is None: raise InternalException( 'compile_manifest called before manifest was loaded' ) self.linker = compile_manifest(self.config, self.manifest)
def compile_manifest(self): self.linker = compile_manifest(self.config, self.manifest) self.manifest.build_flat_graph()
def _runtime_initialize(self): self.manifest = load_manifest(self.config) self.linker = compile_manifest(self.config, self.manifest)