We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[Stephen Girard] resource list shows sources as None
To be fixed for the 0.13.0 (Stephen Girard) release. An invocation of `dbt run` shows:

```
Found 162 models, 320 tests, 0 archives, 0 analyses, 236 macros, 2 operations, 4 seed files, 34 None
                                                                                                 ^
                                                                                                 |
```

We should also add an assert, as this should fail immediately in development (it's easy to miss!)

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `core/dbt/compilation.py`
Content:
```
1 import itertools
2 import os
3 import json
4 from collections import OrderedDict, defaultdict
5 import sqlparse
6 
7 import dbt.utils
8 import dbt.include
9 import dbt.tracking
10 
11 from dbt import deprecations
12 from dbt.utils import get_materialization, NodeType, is_type
13 from dbt.linker import Linker
14 
15 import dbt.compat
16 import dbt.context.runtime
17 import dbt.contracts.project
18 import dbt.exceptions
19 import dbt.flags
20 import dbt.loader
21 import dbt.config
22 from dbt.contracts.graph.compiled import CompiledNode, CompiledGraph
23 
24 from dbt.clients.system import write_json
25 from dbt.logger import GLOBAL_LOGGER as logger
26 
27 graph_file_name = 'graph.gpickle'
28 
29 
30 def print_compile_stats(stats):
31     names = {
32         NodeType.Model: 'models',
33         NodeType.Test: 'tests',
34         NodeType.Archive: 'archives',
35         NodeType.Analysis: 'analyses',
36         NodeType.Macro: 'macros',
37         NodeType.Operation: 'operations',
38         NodeType.Seed: 'seed files',
39     }
40 
41     results = {k: 0 for k in names.keys()}
42     results.update(stats)
43 
44     stat_line = ", ".join(
45         ["{} {}".format(ct, names.get(t)) for t, ct in results.items()])
46 
47     logger.info("Found {}".format(stat_line))
48 
49 
50 def _add_prepended_cte(prepended_ctes, new_cte):
51     for dct in prepended_ctes:
52         if dct['id'] == new_cte['id']:
53             dct['sql'] = new_cte['sql']
54             return
55     prepended_ctes.append(new_cte)
56 
57 
58 def _extend_prepended_ctes(prepended_ctes, new_prepended_ctes):
59     for new_cte in new_prepended_ctes:
60         _add_prepended_cte(prepended_ctes, new_cte)
61 
62 
63 def prepend_ctes(model, manifest):
64     model, _, manifest = recursively_prepend_ctes(model, manifest)
65 
66     return (model, manifest)
67 
68 
69 def recursively_prepend_ctes(model, manifest):
70     if model.extra_ctes_injected:
71         return (model, model.extra_ctes, manifest)
72 
73     if dbt.flags.STRICT_MODE:
74         # ensure that the cte we're adding to is compiled
75         CompiledNode(**model.serialize())
76 
77     prepended_ctes = []
78 
79     for cte in model.extra_ctes:
80         cte_id = cte['id']
81         cte_to_add = manifest.nodes.get(cte_id)
82         cte_to_add, new_prepended_ctes, manifest = recursively_prepend_ctes(
83             cte_to_add, manifest)
84         _extend_prepended_ctes(prepended_ctes, new_prepended_ctes)
85         new_cte_name = '__dbt__CTE__{}'.format(cte_to_add.get('name'))
86         sql = ' {} as (\n{}\n)'.format(new_cte_name, cte_to_add.compiled_sql)
87         _add_prepended_cte(prepended_ctes, {'id': cte_id, 'sql': sql})
88 
89     model.prepend_ctes(prepended_ctes)
90 
91     manifest.nodes[model.unique_id] = model
92 
93     return (model, prepended_ctes, manifest)
94 
95 
96 class Compiler(object):
97     def __init__(self, config):
98         self.config = config
99 
100     def initialize(self):
101         dbt.clients.system.make_directory(self.config.target_path)
102         dbt.clients.system.make_directory(self.config.modules_path)
103 
104     def compile_node(self, node, manifest, extra_context=None):
105         if extra_context is None:
106             extra_context = {}
107 
108         logger.debug("Compiling {}".format(node.get('unique_id')))
109 
110         data = node.to_dict()
111         data.update({
112             'compiled': False,
113             'compiled_sql': None,
114             'extra_ctes_injected': False,
115             'extra_ctes': [],
116             'injected_sql': None,
117         })
118         compiled_node = CompiledNode(**data)
119 
120         context = dbt.context.runtime.generate(
121             compiled_node, self.config, manifest)
122         context.update(extra_context)
123 
124         compiled_node.compiled_sql = dbt.clients.jinja.get_rendered(
125             node.get('raw_sql'),
126             context,
127             node)
128 
129         compiled_node.compiled = True
130 
131         injected_node, _ = prepend_ctes(compiled_node, manifest)
132 
133         should_wrap = {NodeType.Test, NodeType.Operation}
134         if injected_node.resource_type in should_wrap:
135             # data tests get wrapped in count(*)
136             # TODO : move this somewhere more reasonable
137             if 'data' in injected_node.tags and \
138                is_type(injected_node, NodeType.Test):
139                 injected_node.wrapped_sql = (
140                     "select count(*) from (\n{test_sql}\n) sbq").format(
141                         test_sql=injected_node.injected_sql)
142             else:
143                 # don't wrap schema tests or analyses.
144                 injected_node.wrapped_sql = injected_node.injected_sql
145 
146         elif is_type(injected_node, NodeType.Archive):
147             # unfortunately we do everything automagically for
148             # archives. in the future it'd be nice to generate
149             # the SQL at the parser level.
150             pass
151 
152         elif(is_type(injected_node, NodeType.Model) and
153              get_materialization(injected_node) == 'ephemeral'):
154             pass
155 
156         else:
157             injected_node.wrapped_sql = None
158 
159         return injected_node
160 
161     def write_graph_file(self, linker, manifest):
162         filename = graph_file_name
163         graph_path = os.path.join(self.config.target_path, filename)
164         linker.write_graph(graph_path, manifest)
165 
166     def link_node(self, linker, node, manifest):
167         linker.add_node(node.unique_id)
168 
169         for dependency in node.depends_on_nodes:
170             if manifest.nodes.get(dependency):
171                 linker.dependency(
172                     node.unique_id,
173                     (manifest.nodes.get(dependency).unique_id))
174             else:
175                 dbt.exceptions.dependency_not_found(node, dependency)
176 
177     def link_graph(self, linker, manifest):
178         for node in manifest.nodes.values():
179             self.link_node(linker, node, manifest)
180 
181         cycle = linker.find_cycles()
182 
183         if cycle:
184             raise RuntimeError("Found a cycle: {}".format(cycle))
185 
186     def compile(self, manifest):
187         linker = Linker()
188 
189         self.link_graph(linker, manifest)
190 
191         stats = defaultdict(int)
192 
193         for node_name, node in itertools.chain(
194                 manifest.nodes.items(),
195                 manifest.macros.items()):
196             stats[node.resource_type] += 1
197 
198         self.write_graph_file(linker, manifest)
199         print_compile_stats(stats)
200 
201         return linker
202 
203 
204 def compile_manifest(config, manifest):
205     compiler = Compiler(config)
206     compiler.initialize()
207     return compiler.compile(manifest)
208 
209 
210 def compile_node(adapter, config, node, manifest, extra_context):
211     compiler = Compiler(config)
212     node = compiler.compile_node(node, manifest, extra_context)
213     node = _inject_runtime_config(adapter, node, extra_context)
214 
215     if(node.injected_sql is not None and
216        not (dbt.utils.is_type(node, NodeType.Archive))):
217         logger.debug('Writing injected SQL for node "{}"'.format(
218             node.unique_id))
219 
220         written_path = dbt.writer.write_node(
221             node,
222             config.target_path,
223             'compiled',
224             node.injected_sql)
225 
226         node.build_path = written_path
227 
228     return node
229 
230 
231 def _inject_runtime_config(adapter, node, extra_context):
232     wrapped_sql = node.wrapped_sql
233     context = _node_context(adapter, node)
234     context.update(extra_context)
235     sql = dbt.clients.jinja.get_rendered(wrapped_sql, context)
236     node.wrapped_sql = sql
237     return node
238 
239 
240 def _node_context(adapter, node):
241     return {
242         "run_started_at": dbt.tracking.active_user.run_started_at,
243         "invocation_id": dbt.tracking.active_user.invocation_id,
244     }
245
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/core/dbt/compilation.py b/core/dbt/compilation.py
--- a/core/dbt/compilation.py
+++ b/core/dbt/compilation.py
@@ -36,6 +36,7 @@
         NodeType.Macro: 'macros',
         NodeType.Operation: 'operations',
         NodeType.Seed: 'seed files',
+        NodeType.Source: 'sources',
     }
 
     results = {k: 0 for k in names.keys()}

{"golden_diff": "diff --git a/core/dbt/compilation.py b/core/dbt/compilation.py\n--- a/core/dbt/compilation.py\n+++ b/core/dbt/compilation.py\n@@ -36,6 +36,7 @@\n         NodeType.Macro: 'macros',\n         NodeType.Operation: 'operations',\n         NodeType.Seed: 'seed files',\n+        NodeType.Source: 'sources',\n     }\n \n     results = {k: 0 for k in names.keys()}\n", "issue": "[Stephen Girard] resource list shows sources as None\nTo be fixed for the 0.13.0 (Stephen Girard) release. An invocation of `dbt run` shows:\r\n\r\n```\r\nFound 162 models, 320 tests, 0 archives, 0 analyses, 236 macros, 2 operations, 4 seed files, 34 None\r\n                                                                                                 ^\r\n                                                                                                 |\r\n```\r\n\r\nWe should also add an assert, as this should fail immediately in development (it's easy to miss!)\n", "before_files": [{"content": "import itertools\nimport os\nimport json\nfrom collections import OrderedDict, defaultdict\nimport sqlparse\n\nimport dbt.utils\nimport dbt.include\nimport dbt.tracking\n\nfrom dbt import deprecations\nfrom dbt.utils import get_materialization, NodeType, is_type\nfrom dbt.linker import Linker\n\nimport dbt.compat\nimport dbt.context.runtime\nimport dbt.contracts.project\nimport dbt.exceptions\nimport dbt.flags\nimport dbt.loader\nimport dbt.config\nfrom dbt.contracts.graph.compiled import CompiledNode, CompiledGraph\n\nfrom dbt.clients.system import write_json\nfrom dbt.logger import GLOBAL_LOGGER as logger\n\ngraph_file_name = 'graph.gpickle'\n\n\ndef print_compile_stats(stats):\n    names = {\n        NodeType.Model: 'models',\n        NodeType.Test: 'tests',\n        NodeType.Archive: 'archives',\n        NodeType.Analysis: 'analyses',\n        NodeType.Macro: 'macros',\n        NodeType.Operation: 'operations',\n        NodeType.Seed: 'seed files',\n    }\n\n    results = {k: 0 for k in names.keys()}\n    results.update(stats)\n\n    stat_line = \", \".join(\n        [\"{} {}\".format(ct, names.get(t)) for t, ct in results.items()])\n\n    logger.info(\"Found {}\".format(stat_line))\n\n\ndef _add_prepended_cte(prepended_ctes, new_cte):\n    for dct in prepended_ctes:\n        if dct['id'] == new_cte['id']:\n            dct['sql'] = new_cte['sql']\n            return\n    prepended_ctes.append(new_cte)\n\n\ndef _extend_prepended_ctes(prepended_ctes, new_prepended_ctes):\n    for new_cte in new_prepended_ctes:\n        _add_prepended_cte(prepended_ctes, new_cte)\n\n\ndef prepend_ctes(model, manifest):\n    model, _, manifest = recursively_prepend_ctes(model, manifest)\n\n    return (model, manifest)\n\n\ndef recursively_prepend_ctes(model, manifest):\n    if model.extra_ctes_injected:\n        return (model, model.extra_ctes, manifest)\n\n    if dbt.flags.STRICT_MODE:\n        # ensure that the cte we're adding to is compiled\n        CompiledNode(**model.serialize())\n\n    prepended_ctes = []\n\n    for cte in model.extra_ctes:\n        cte_id = cte['id']\n        cte_to_add = manifest.nodes.get(cte_id)\n        cte_to_add, new_prepended_ctes, manifest = recursively_prepend_ctes(\n            cte_to_add, manifest)\n        _extend_prepended_ctes(prepended_ctes, new_prepended_ctes)\n        new_cte_name = '__dbt__CTE__{}'.format(cte_to_add.get('name'))\n        sql = ' {} as (\\n{}\\n)'.format(new_cte_name, cte_to_add.compiled_sql)\n        _add_prepended_cte(prepended_ctes, {'id': cte_id, 'sql': sql})\n\n    model.prepend_ctes(prepended_ctes)\n\n    manifest.nodes[model.unique_id] = model\n\n    return (model, prepended_ctes, manifest)\n\n\nclass Compiler(object):\n    def __init__(self, config):\n        self.config = config\n\n    def initialize(self):\n        dbt.clients.system.make_directory(self.config.target_path)\n        dbt.clients.system.make_directory(self.config.modules_path)\n\n    def compile_node(self, node, manifest, extra_context=None):\n        if extra_context is None:\n            extra_context = {}\n\n        logger.debug(\"Compiling {}\".format(node.get('unique_id')))\n\n        data = node.to_dict()\n        data.update({\n            'compiled': False,\n            'compiled_sql': None,\n            'extra_ctes_injected': False,\n            'extra_ctes': [],\n            'injected_sql': None,\n        })\n        compiled_node = CompiledNode(**data)\n\n        context = dbt.context.runtime.generate(\n            compiled_node, self.config, manifest)\n        context.update(extra_context)\n\n        compiled_node.compiled_sql = dbt.clients.jinja.get_rendered(\n            node.get('raw_sql'),\n            context,\n            node)\n\n        compiled_node.compiled = True\n\n        injected_node, _ = prepend_ctes(compiled_node, manifest)\n\n        should_wrap = {NodeType.Test, NodeType.Operation}\n        if injected_node.resource_type in should_wrap:\n            # data tests get wrapped in count(*)\n            # TODO : move this somewhere more reasonable\n            if 'data' in injected_node.tags and \\\n               is_type(injected_node, NodeType.Test):\n                injected_node.wrapped_sql = (\n                    \"select count(*) from (\\n{test_sql}\\n) sbq\").format(\n                        test_sql=injected_node.injected_sql)\n            else:\n                # don't wrap schema tests or analyses.\n                injected_node.wrapped_sql = injected_node.injected_sql\n\n        elif is_type(injected_node, NodeType.Archive):\n            # unfortunately we do everything automagically for\n            # archives. in the future it'd be nice to generate\n            # the SQL at the parser level.\n            pass\n\n        elif(is_type(injected_node, NodeType.Model) and\n             get_materialization(injected_node) == 'ephemeral'):\n            pass\n\n        else:\n            injected_node.wrapped_sql = None\n\n        return injected_node\n\n    def write_graph_file(self, linker, manifest):\n        filename = graph_file_name\n        graph_path = os.path.join(self.config.target_path, filename)\n        linker.write_graph(graph_path, manifest)\n\n    def link_node(self, linker, node, manifest):\n        linker.add_node(node.unique_id)\n\n        for dependency in node.depends_on_nodes:\n            if manifest.nodes.get(dependency):\n                linker.dependency(\n                    node.unique_id,\n                    (manifest.nodes.get(dependency).unique_id))\n            else:\n                dbt.exceptions.dependency_not_found(node, dependency)\n\n    def link_graph(self, linker, manifest):\n        for node in manifest.nodes.values():\n            self.link_node(linker, node, manifest)\n\n        cycle = linker.find_cycles()\n\n        if cycle:\n            raise RuntimeError(\"Found a cycle: {}\".format(cycle))\n\n    def compile(self, manifest):\n        linker = Linker()\n\n        self.link_graph(linker, manifest)\n\n        stats = defaultdict(int)\n\n        for node_name, node in itertools.chain(\n                manifest.nodes.items(),\n                manifest.macros.items()):\n            stats[node.resource_type] += 1\n\n        self.write_graph_file(linker, manifest)\n        print_compile_stats(stats)\n\n        return linker\n\n\ndef compile_manifest(config, manifest):\n    compiler = Compiler(config)\n    compiler.initialize()\n    return compiler.compile(manifest)\n\n\ndef compile_node(adapter, config, node, manifest, extra_context):\n    compiler = Compiler(config)\n    node = compiler.compile_node(node, manifest, extra_context)\n    node = _inject_runtime_config(adapter, node, extra_context)\n\n    if(node.injected_sql is not None and\n       not (dbt.utils.is_type(node, NodeType.Archive))):\n        logger.debug('Writing injected SQL for node \"{}\"'.format(\n            node.unique_id))\n\n        written_path = dbt.writer.write_node(\n            node,\n            config.target_path,\n            'compiled',\n            node.injected_sql)\n\n        node.build_path = written_path\n\n    return node\n\n\ndef _inject_runtime_config(adapter, node, extra_context):\n    wrapped_sql = node.wrapped_sql\n    context = _node_context(adapter, node)\n    context.update(extra_context)\n    sql = dbt.clients.jinja.get_rendered(wrapped_sql, context)\n    node.wrapped_sql = sql\n    return node\n\n\ndef _node_context(adapter, node):\n    return {\n        \"run_started_at\": dbt.tracking.active_user.run_started_at,\n        \"invocation_id\": dbt.tracking.active_user.invocation_id,\n    }\n", "path": "core/dbt/compilation.py"}], "after_files": [{"content": "import itertools\nimport os\nimport json\nfrom collections import OrderedDict, defaultdict\nimport sqlparse\n\nimport dbt.utils\nimport dbt.include\nimport dbt.tracking\n\nfrom dbt import deprecations\nfrom dbt.utils import get_materialization, NodeType, is_type\nfrom dbt.linker import Linker\n\nimport dbt.compat\nimport dbt.context.runtime\nimport dbt.contracts.project\nimport dbt.exceptions\nimport dbt.flags\nimport dbt.loader\nimport dbt.config\nfrom dbt.contracts.graph.compiled import CompiledNode, CompiledGraph\n\nfrom dbt.clients.system import write_json\nfrom dbt.logger import GLOBAL_LOGGER as logger\n\ngraph_file_name = 'graph.gpickle'\n\n\ndef print_compile_stats(stats):\n    names = {\n        NodeType.Model: 'models',\n        NodeType.Test: 'tests',\n        NodeType.Archive: 'archives',\n        NodeType.Analysis: 'analyses',\n        NodeType.Macro: 'macros',\n        NodeType.Operation: 'operations',\n        NodeType.Seed: 'seed files',\n        NodeType.Source: 'sources',\n    }\n\n    results = {k: 0 for k in names.keys()}\n    results.update(stats)\n\n    stat_line = \", \".join(\n        [\"{} {}\".format(ct, names.get(t)) for t, ct in results.items()])\n\n    logger.info(\"Found {}\".format(stat_line))\n\n\ndef _add_prepended_cte(prepended_ctes, new_cte):\n    for dct in prepended_ctes:\n        if dct['id'] == new_cte['id']:\n            dct['sql'] = new_cte['sql']\n            return\n    prepended_ctes.append(new_cte)\n\n\ndef _extend_prepended_ctes(prepended_ctes, new_prepended_ctes):\n    for new_cte in new_prepended_ctes:\n        _add_prepended_cte(prepended_ctes, new_cte)\n\n\ndef prepend_ctes(model, manifest):\n    model, _, manifest = recursively_prepend_ctes(model, manifest)\n\n    return (model, manifest)\n\n\ndef recursively_prepend_ctes(model, manifest):\n    if model.extra_ctes_injected:\n        return (model, model.extra_ctes, manifest)\n\n    if dbt.flags.STRICT_MODE:\n        # ensure that the cte we're adding to is compiled\n        CompiledNode(**model.serialize())\n\n    prepended_ctes = []\n\n    for cte in model.extra_ctes:\n        cte_id = cte['id']\n        cte_to_add = manifest.nodes.get(cte_id)\n        cte_to_add, new_prepended_ctes, manifest = recursively_prepend_ctes(\n            cte_to_add, manifest)\n        _extend_prepended_ctes(prepended_ctes, new_prepended_ctes)\n        new_cte_name = '__dbt__CTE__{}'.format(cte_to_add.get('name'))\n        sql = ' {} as (\\n{}\\n)'.format(new_cte_name, cte_to_add.compiled_sql)\n        _add_prepended_cte(prepended_ctes, {'id': cte_id, 'sql': sql})\n\n    model.prepend_ctes(prepended_ctes)\n\n    manifest.nodes[model.unique_id] = model\n\n    return (model, prepended_ctes, manifest)\n\n\nclass Compiler(object):\n    def __init__(self, config):\n        self.config = config\n\n    def initialize(self):\n        dbt.clients.system.make_directory(self.config.target_path)\n        dbt.clients.system.make_directory(self.config.modules_path)\n\n    def compile_node(self, node, manifest, extra_context=None):\n        if extra_context is None:\n            extra_context = {}\n\n        logger.debug(\"Compiling {}\".format(node.get('unique_id')))\n\n        data = node.to_dict()\n        data.update({\n            'compiled': False,\n            'compiled_sql': None,\n            'extra_ctes_injected': False,\n            'extra_ctes': [],\n            'injected_sql': None,\n        })\n        compiled_node = CompiledNode(**data)\n\n        context = dbt.context.runtime.generate(\n            compiled_node, self.config, manifest)\n        context.update(extra_context)\n\n        compiled_node.compiled_sql = dbt.clients.jinja.get_rendered(\n            node.get('raw_sql'),\n            context,\n            node)\n\n        compiled_node.compiled = True\n\n        injected_node, _ = prepend_ctes(compiled_node, manifest)\n\n        should_wrap = {NodeType.Test, NodeType.Operation}\n        if injected_node.resource_type in should_wrap:\n            # data tests get wrapped in count(*)\n            # TODO : move this somewhere more reasonable\n            if 'data' in injected_node.tags and \\\n               is_type(injected_node, NodeType.Test):\n                injected_node.wrapped_sql = (\n                    \"select count(*) from (\\n{test_sql}\\n) sbq\").format(\n                        test_sql=injected_node.injected_sql)\n            else:\n                # don't wrap schema tests or analyses.\n                injected_node.wrapped_sql = injected_node.injected_sql\n\n        elif is_type(injected_node, NodeType.Archive):\n            # unfortunately we do everything automagically for\n            # archives. in the future it'd be nice to generate\n            # the SQL at the parser level.\n            pass\n\n        elif(is_type(injected_node, NodeType.Model) and\n             get_materialization(injected_node) == 'ephemeral'):\n            pass\n\n        else:\n            injected_node.wrapped_sql = None\n\n        return injected_node\n\n    def write_graph_file(self, linker, manifest):\n        filename = graph_file_name\n        graph_path = os.path.join(self.config.target_path, filename)\n        linker.write_graph(graph_path, manifest)\n\n    def link_node(self, linker, node, manifest):\n        linker.add_node(node.unique_id)\n\n        for dependency in node.depends_on_nodes:\n            if manifest.nodes.get(dependency):\n                linker.dependency(\n                    node.unique_id,\n                    (manifest.nodes.get(dependency).unique_id))\n            else:\n                dbt.exceptions.dependency_not_found(node, dependency)\n\n    def link_graph(self, linker, manifest):\n        for node in manifest.nodes.values():\n            self.link_node(linker, node, manifest)\n\n        cycle = linker.find_cycles()\n\n        if cycle:\n            raise RuntimeError(\"Found a cycle: {}\".format(cycle))\n\n    def compile(self, manifest):\n        linker = Linker()\n\n        self.link_graph(linker, manifest)\n\n        stats = defaultdict(int)\n\n        for node_name, node in itertools.chain(\n                manifest.nodes.items(),\n                manifest.macros.items()):\n            stats[node.resource_type] += 1\n\n        self.write_graph_file(linker, manifest)\n        print_compile_stats(stats)\n\n        return linker\n\n\ndef compile_manifest(config, manifest):\n    compiler = Compiler(config)\n    compiler.initialize()\n    return compiler.compile(manifest)\n\n\ndef compile_node(adapter, config, node, manifest, extra_context):\n    compiler = Compiler(config)\n    node = compiler.compile_node(node, manifest, extra_context)\n    node = _inject_runtime_config(adapter, node, extra_context)\n\n    if(node.injected_sql is not None and\n       not (dbt.utils.is_type(node, NodeType.Archive))):\n        logger.debug('Writing injected SQL for node \"{}\"'.format(\n            node.unique_id))\n\n        written_path = dbt.writer.write_node(\n            node,\n            config.target_path,\n            'compiled',\n            node.injected_sql)\n\n        node.build_path = written_path\n\n    return node\n\n\ndef _inject_runtime_config(adapter, node, extra_context):\n    wrapped_sql = node.wrapped_sql\n    context = _node_context(adapter, node)\n    context.update(extra_context)\n    sql = dbt.clients.jinja.get_rendered(wrapped_sql, context)\n    node.wrapped_sql = sql\n    return node\n\n\ndef _node_context(adapter, node):\n    return {\n        \"run_started_at\": dbt.tracking.active_user.run_started_at,\n        \"invocation_id\": dbt.tracking.active_user.invocation_id,\n    }\n", "path": "core/dbt/compilation.py"}]}