We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Rename RPC methods
### Describe the feature
The RPC server currently supports the following endpoints:
 - compile
 - run
 - compile_project
 - run_project
 - seed_project
 - test_project

These endpoints should be remapped to:
 - compile_sql
 - run_sql
 - compile
 - run
 - seed
 - test

This will obviously be a breaking change for anyone using the RPC server, but we're going to have to do it eventually, so we might as well do it now! Parity between the RPC methods and CLI arguments will be drastically less confusing for dbt users in the long run.

--- 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/task/remote.py`
Content:
```
1 import signal
2 import threading
3 from dataclasses import dataclass
4 from datetime import datetime
5 from typing import Union, List, Optional
6 
7 from hologram import JsonSchemaMixin
8 
9 from dbt.adapters.factory import get_adapter
10 from dbt.clients.jinja import extract_toplevel_blocks
11 from dbt.compilation import compile_manifest
12 from dbt.parser.results import ParseResult
13 from dbt.parser.rpc import RPCCallParser, RPCMacroParser
14 from dbt.parser.util import ParserUtils
15 import dbt.ui.printer
16 from dbt.logger import GLOBAL_LOGGER as logger
17 from dbt.rpc.node_runners import RPCCompileRunner, RPCExecuteRunner
18 from dbt.rpc.task import RemoteCallableResult, RPCTask
19 
20 from dbt.task.run import RunTask
21 from dbt.task.seed import SeedTask
22 from dbt.task.test import TestTask
23 
24 
25 @dataclass
26 class RPCExecParameters(JsonSchemaMixin):
27     name: str
28     sql: str
29     macros: Optional[str]
30 
31 
32 @dataclass
33 class RPCCompileProjectParameters(JsonSchemaMixin):
34     models: Union[None, str, List[str]] = None
35     exclude: Union[None, str, List[str]] = None
36 
37 
38 @dataclass
39 class RPCTestProjectParameters(RPCCompileProjectParameters):
40     data: bool = False
41     schema: bool = False
42 
43 
44 @dataclass
45 class RPCSeedProjectParameters(JsonSchemaMixin):
46     show: bool = False
47 
48 
49 class _RPCExecTask(RPCTask):
50     def __init__(self, args, config, manifest):
51         super().__init__(args, config)
52         self._base_manifest = manifest.deepcopy(config=config)
53 
54     def runtime_cleanup(self, selected_uids):
55         """Do some pre-run cleanup that is usually performed in Task __init__.
56         """
57         self.run_count = 0
58         self.num_nodes = len(selected_uids)
59         self.node_results = []
60         self._skipped_children = {}
61         self._skipped_children = {}
62         self._raise_next_tick = None
63 
64     def _extract_request_data(self, data):
65         data = self.decode_sql(data)
66         macro_blocks = []
67         data_chunks = []
68         for block in extract_toplevel_blocks(data):
69             if block.block_type_name == 'macro':
70                 macro_blocks.append(block.full_block)
71             else:
72                 data_chunks.append(block.full_block)
73         macros = '\n'.join(macro_blocks)
74         sql = ''.join(data_chunks)
75         return sql, macros
76 
77     def _get_exec_node(self, name, sql, macros):
78         results = ParseResult.rpc()
79         macro_overrides = {}
80         sql, macros = self._extract_request_data(sql)
81 
82         if macros:
83             macro_parser = RPCMacroParser(results, self.config)
84             for node in macro_parser.parse_remote(macros):
85                 macro_overrides[node.unique_id] = node
86 
87         self._base_manifest.macros.update(macro_overrides)
88         rpc_parser = RPCCallParser(
89             results=results,
90             project=self.config,
91             root_project=self.config,
92             macro_manifest=self._base_manifest,
93         )
94         node = rpc_parser.parse_remote(sql, name)
95         self.manifest = ParserUtils.add_new_refs(
96             manifest=self._base_manifest,
97             current_project=self.config,
98             node=node,
99             macros=macro_overrides
100         )
101 
102         # don't write our new, weird manifest!
103         self.linker = compile_manifest(self.config, self.manifest, write=False)
104         return node
105 
106     def _raise_set_error(self):
107         if self._raise_next_tick is not None:
108             raise self._raise_next_tick
109 
110     def _in_thread(self, node, thread_done):
111         runner = self.get_runner(node)
112         try:
113             self.node_results.append(runner.safe_run(self.manifest))
114         except Exception as exc:
115             logger.debug('Got exception {}'.format(exc), exc_info=True)
116             self._raise_next_tick = exc
117         finally:
118             thread_done.set()
119 
120     def handle_request(
121         self, params: RPCExecParameters
122     ) -> RemoteCallableResult:
123         # we could get a ctrl+c at any time, including during parsing.
124         thread = None
125         started = datetime.utcnow()
126         try:
127             node = self._get_exec_node(params.name, params.sql, params.macros)
128 
129             selected_uids = [node.unique_id]
130             self.runtime_cleanup(selected_uids)
131 
132             thread_done = threading.Event()
133             thread = threading.Thread(target=self._in_thread,
134                                       args=(node, thread_done))
135             thread.start()
136             thread_done.wait()
137         except KeyboardInterrupt:
138             adapter = get_adapter(self.config)
139             if adapter.is_cancelable():
140 
141                 for conn_name in adapter.cancel_open_connections():
142                     logger.debug('canceled query {}'.format(conn_name))
143                 if thread:
144                     thread.join()
145             else:
146                 msg = ("The {} adapter does not support query "
147                        "cancellation. Some queries may still be "
148                        "running!".format(adapter.type()))
149 
150                 logger.debug(msg)
151 
152             raise dbt.exceptions.RPCKilledException(signal.SIGINT)
153 
154         self._raise_set_error()
155 
156         ended = datetime.utcnow()
157         elapsed = (ended - started).total_seconds()
158         return self.get_result(
159             results=self.node_results,
160             elapsed_time=elapsed,
161             generated_at=ended,
162         )
163 
164 
165 class RemoteCompileTask(_RPCExecTask):
166     METHOD_NAME = 'compile'
167 
168     def get_runner_type(self):
169         return RPCCompileRunner
170 
171 
172 class RemoteRunTask(_RPCExecTask, RunTask):
173     METHOD_NAME = 'run'
174 
175     def get_runner_type(self):
176         return RPCExecuteRunner
177 
178 
179 class RemoteCompileProjectTask(RPCTask):
180     METHOD_NAME = 'compile_project'
181 
182     def __init__(self, args, config, manifest):
183         super().__init__(args, config)
184         self.manifest = manifest.deepcopy(config=config)
185 
186     def load_manifest(self):
187         # we started out with a manifest!
188         pass
189 
190     def handle_request(
191         self, params: RPCCompileProjectParameters
192     ) -> RemoteCallableResult:
193         self.args.models = self._listify(params.models)
194         self.args.exclude = self._listify(params.exclude)
195 
196         results = self.run()
197         return results
198 
199 
200 class RemoteRunProjectTask(RPCTask, RunTask):
201     METHOD_NAME = 'run_project'
202 
203     def __init__(self, args, config, manifest):
204         super().__init__(args, config)
205         self.manifest = manifest.deepcopy(config=config)
206 
207     def load_manifest(self):
208         # we started out with a manifest!
209         pass
210 
211     def handle_request(
212         self, params: RPCCompileProjectParameters
213     ) -> RemoteCallableResult:
214         self.args.models = self._listify(params.models)
215         self.args.exclude = self._listify(params.exclude)
216 
217         results = self.run()
218         return results
219 
220 
221 class RemoteSeedProjectTask(RPCTask, SeedTask):
222     METHOD_NAME = 'seed_project'
223 
224     def __init__(self, args, config, manifest):
225         super().__init__(args, config)
226         self.manifest = manifest.deepcopy(config=config)
227 
228     def load_manifest(self):
229         # we started out with a manifest!
230         pass
231 
232     def handle_request(
233         self, params: RPCSeedProjectParameters
234     ) -> RemoteCallableResult:
235         self.args.show = params.show
236 
237         results = self.run()
238         return results
239 
240 
241 class RemoteTestProjectTask(RPCTask, TestTask):
242     METHOD_NAME = 'test_project'
243 
244     def __init__(self, args, config, manifest):
245         super().__init__(args, config)
246         self.manifest = manifest.deepcopy(config=config)
247 
248     def load_manifest(self):
249         # we started out with a manifest!
250         pass
251 
252     def handle_request(
253         self, params: RPCTestProjectParameters,
254     ) -> RemoteCallableResult:
255         self.args.models = self._listify(params.models)
256         self.args.exclude = self._listify(params.exclude)
257         self.args.data = params.data
258         self.args.schema = params.schema
259 
260         results = self.run()
261         return results
262
```
--- 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/task/remote.py b/core/dbt/task/remote.py
--- a/core/dbt/task/remote.py
+++ b/core/dbt/task/remote.py
@@ -163,21 +163,21 @@
 
 
 class RemoteCompileTask(_RPCExecTask):
-    METHOD_NAME = 'compile'
+    METHOD_NAME = 'compile_sql'
 
     def get_runner_type(self):
         return RPCCompileRunner
 
 
 class RemoteRunTask(_RPCExecTask, RunTask):
-    METHOD_NAME = 'run'
+    METHOD_NAME = 'run_sql'
 
     def get_runner_type(self):
         return RPCExecuteRunner
 
 
 class RemoteCompileProjectTask(RPCTask):
-    METHOD_NAME = 'compile_project'
+    METHOD_NAME = 'compile'
 
     def __init__(self, args, config, manifest):
         super().__init__(args, config)
@@ -198,7 +198,7 @@
 
 
 class RemoteRunProjectTask(RPCTask, RunTask):
-    METHOD_NAME = 'run_project'
+    METHOD_NAME = 'run'
 
     def __init__(self, args, config, manifest):
         super().__init__(args, config)
@@ -219,7 +219,7 @@
 
 
 class RemoteSeedProjectTask(RPCTask, SeedTask):
-    METHOD_NAME = 'seed_project'
+    METHOD_NAME = 'seed'
 
     def __init__(self, args, config, manifest):
         super().__init__(args, config)
@@ -239,7 +239,7 @@
 
 
 class RemoteTestProjectTask(RPCTask, TestTask):
-    METHOD_NAME = 'test_project'
+    METHOD_NAME = 'test'
 
     def __init__(self, args, config, manifest):
         super().__init__(args, config)

{"golden_diff": "diff --git a/core/dbt/task/remote.py b/core/dbt/task/remote.py\n--- a/core/dbt/task/remote.py\n+++ b/core/dbt/task/remote.py\n@@ -163,21 +163,21 @@\n \n \n class RemoteCompileTask(_RPCExecTask):\n-    METHOD_NAME = 'compile'\n+    METHOD_NAME = 'compile_sql'\n \n     def get_runner_type(self):\n         return RPCCompileRunner\n \n \n class RemoteRunTask(_RPCExecTask, RunTask):\n-    METHOD_NAME = 'run'\n+    METHOD_NAME = 'run_sql'\n \n     def get_runner_type(self):\n         return RPCExecuteRunner\n \n \n class RemoteCompileProjectTask(RPCTask):\n-    METHOD_NAME = 'compile_project'\n+    METHOD_NAME = 'compile'\n \n     def __init__(self, args, config, manifest):\n         super().__init__(args, config)\n@@ -198,7 +198,7 @@\n \n \n class RemoteRunProjectTask(RPCTask, RunTask):\n-    METHOD_NAME = 'run_project'\n+    METHOD_NAME = 'run'\n \n     def __init__(self, args, config, manifest):\n         super().__init__(args, config)\n@@ -219,7 +219,7 @@\n \n \n class RemoteSeedProjectTask(RPCTask, SeedTask):\n-    METHOD_NAME = 'seed_project'\n+    METHOD_NAME = 'seed'\n \n     def __init__(self, args, config, manifest):\n         super().__init__(args, config)\n@@ -239,7 +239,7 @@\n \n \n class RemoteTestProjectTask(RPCTask, TestTask):\n-    METHOD_NAME = 'test_project'\n+    METHOD_NAME = 'test'\n \n     def __init__(self, args, config, manifest):\n         super().__init__(args, config)\n", "issue": "Rename RPC methods\n### Describe the feature\r\nThe RPC server currently supports the following endpoints:\r\n - compile\r\n - run\r\n - compile_project\r\n - run_project\r\n - seed_project\r\n - test_project\r\n\r\nThese endpoints should be remapped to:\r\n - compile_sql\r\n - run_sql\r\n - compile\r\n - run\r\n - seed\r\n - test\r\n\r\nThis will obviously be a breaking change for anyone using the RPC server, but we're going to have to do it eventually, so we might as well do it now! Parity between the RPC methods and CLI arguments will be drastically less confusing for dbt users in the long run.\n", "before_files": [{"content": "import signal\nimport threading\nfrom dataclasses import dataclass\nfrom datetime import datetime\nfrom typing import Union, List, Optional\n\nfrom hologram import JsonSchemaMixin\n\nfrom dbt.adapters.factory import get_adapter\nfrom dbt.clients.jinja import extract_toplevel_blocks\nfrom dbt.compilation import compile_manifest\nfrom dbt.parser.results import ParseResult\nfrom dbt.parser.rpc import RPCCallParser, RPCMacroParser\nfrom dbt.parser.util import ParserUtils\nimport dbt.ui.printer\nfrom dbt.logger import GLOBAL_LOGGER as logger\nfrom dbt.rpc.node_runners import RPCCompileRunner, RPCExecuteRunner\nfrom dbt.rpc.task import RemoteCallableResult, RPCTask\n\nfrom dbt.task.run import RunTask\nfrom dbt.task.seed import SeedTask\nfrom dbt.task.test import TestTask\n\n\n@dataclass\nclass RPCExecParameters(JsonSchemaMixin):\n    name: str\n    sql: str\n    macros: Optional[str]\n\n\n@dataclass\nclass RPCCompileProjectParameters(JsonSchemaMixin):\n    models: Union[None, str, List[str]] = None\n    exclude: Union[None, str, List[str]] = None\n\n\n@dataclass\nclass RPCTestProjectParameters(RPCCompileProjectParameters):\n    data: bool = False\n    schema: bool = False\n\n\n@dataclass\nclass RPCSeedProjectParameters(JsonSchemaMixin):\n    show: bool = False\n\n\nclass _RPCExecTask(RPCTask):\n    def __init__(self, args, config, manifest):\n        super().__init__(args, config)\n        self._base_manifest = manifest.deepcopy(config=config)\n\n    def runtime_cleanup(self, selected_uids):\n        \"\"\"Do some pre-run cleanup that is usually performed in Task __init__.\n        \"\"\"\n        self.run_count = 0\n        self.num_nodes = len(selected_uids)\n        self.node_results = []\n        self._skipped_children = {}\n        self._skipped_children = {}\n        self._raise_next_tick = None\n\n    def _extract_request_data(self, data):\n        data = self.decode_sql(data)\n        macro_blocks = []\n        data_chunks = []\n        for block in extract_toplevel_blocks(data):\n            if block.block_type_name == 'macro':\n                macro_blocks.append(block.full_block)\n            else:\n                data_chunks.append(block.full_block)\n        macros = '\\n'.join(macro_blocks)\n        sql = ''.join(data_chunks)\n        return sql, macros\n\n    def _get_exec_node(self, name, sql, macros):\n        results = ParseResult.rpc()\n        macro_overrides = {}\n        sql, macros = self._extract_request_data(sql)\n\n        if macros:\n            macro_parser = RPCMacroParser(results, self.config)\n            for node in macro_parser.parse_remote(macros):\n                macro_overrides[node.unique_id] = node\n\n        self._base_manifest.macros.update(macro_overrides)\n        rpc_parser = RPCCallParser(\n            results=results,\n            project=self.config,\n            root_project=self.config,\n            macro_manifest=self._base_manifest,\n        )\n        node = rpc_parser.parse_remote(sql, name)\n        self.manifest = ParserUtils.add_new_refs(\n            manifest=self._base_manifest,\n            current_project=self.config,\n            node=node,\n            macros=macro_overrides\n        )\n\n        # don't write our new, weird manifest!\n        self.linker = compile_manifest(self.config, self.manifest, write=False)\n        return node\n\n    def _raise_set_error(self):\n        if self._raise_next_tick is not None:\n            raise self._raise_next_tick\n\n    def _in_thread(self, node, thread_done):\n        runner = self.get_runner(node)\n        try:\n            self.node_results.append(runner.safe_run(self.manifest))\n        except Exception as exc:\n            logger.debug('Got exception {}'.format(exc), exc_info=True)\n            self._raise_next_tick = exc\n        finally:\n            thread_done.set()\n\n    def handle_request(\n        self, params: RPCExecParameters\n    ) -> RemoteCallableResult:\n        # we could get a ctrl+c at any time, including during parsing.\n        thread = None\n        started = datetime.utcnow()\n        try:\n            node = self._get_exec_node(params.name, params.sql, params.macros)\n\n            selected_uids = [node.unique_id]\n            self.runtime_cleanup(selected_uids)\n\n            thread_done = threading.Event()\n            thread = threading.Thread(target=self._in_thread,\n                                      args=(node, thread_done))\n            thread.start()\n            thread_done.wait()\n        except KeyboardInterrupt:\n            adapter = get_adapter(self.config)\n            if adapter.is_cancelable():\n\n                for conn_name in adapter.cancel_open_connections():\n                    logger.debug('canceled query {}'.format(conn_name))\n                if thread:\n                    thread.join()\n            else:\n                msg = (\"The {} adapter does not support query \"\n                       \"cancellation. Some queries may still be \"\n                       \"running!\".format(adapter.type()))\n\n                logger.debug(msg)\n\n            raise dbt.exceptions.RPCKilledException(signal.SIGINT)\n\n        self._raise_set_error()\n\n        ended = datetime.utcnow()\n        elapsed = (ended - started).total_seconds()\n        return self.get_result(\n            results=self.node_results,\n            elapsed_time=elapsed,\n            generated_at=ended,\n        )\n\n\nclass RemoteCompileTask(_RPCExecTask):\n    METHOD_NAME = 'compile'\n\n    def get_runner_type(self):\n        return RPCCompileRunner\n\n\nclass RemoteRunTask(_RPCExecTask, RunTask):\n    METHOD_NAME = 'run'\n\n    def get_runner_type(self):\n        return RPCExecuteRunner\n\n\nclass RemoteCompileProjectTask(RPCTask):\n    METHOD_NAME = 'compile_project'\n\n    def __init__(self, args, config, manifest):\n        super().__init__(args, config)\n        self.manifest = manifest.deepcopy(config=config)\n\n    def load_manifest(self):\n        # we started out with a manifest!\n        pass\n\n    def handle_request(\n        self, params: RPCCompileProjectParameters\n    ) -> RemoteCallableResult:\n        self.args.models = self._listify(params.models)\n        self.args.exclude = self._listify(params.exclude)\n\n        results = self.run()\n        return results\n\n\nclass RemoteRunProjectTask(RPCTask, RunTask):\n    METHOD_NAME = 'run_project'\n\n    def __init__(self, args, config, manifest):\n        super().__init__(args, config)\n        self.manifest = manifest.deepcopy(config=config)\n\n    def load_manifest(self):\n        # we started out with a manifest!\n        pass\n\n    def handle_request(\n        self, params: RPCCompileProjectParameters\n    ) -> RemoteCallableResult:\n        self.args.models = self._listify(params.models)\n        self.args.exclude = self._listify(params.exclude)\n\n        results = self.run()\n        return results\n\n\nclass RemoteSeedProjectTask(RPCTask, SeedTask):\n    METHOD_NAME = 'seed_project'\n\n    def __init__(self, args, config, manifest):\n        super().__init__(args, config)\n        self.manifest = manifest.deepcopy(config=config)\n\n    def load_manifest(self):\n        # we started out with a manifest!\n        pass\n\n    def handle_request(\n        self, params: RPCSeedProjectParameters\n    ) -> RemoteCallableResult:\n        self.args.show = params.show\n\n        results = self.run()\n        return results\n\n\nclass RemoteTestProjectTask(RPCTask, TestTask):\n    METHOD_NAME = 'test_project'\n\n    def __init__(self, args, config, manifest):\n        super().__init__(args, config)\n        self.manifest = manifest.deepcopy(config=config)\n\n    def load_manifest(self):\n        # we started out with a manifest!\n        pass\n\n    def handle_request(\n        self, params: RPCTestProjectParameters,\n    ) -> RemoteCallableResult:\n        self.args.models = self._listify(params.models)\n        self.args.exclude = self._listify(params.exclude)\n        self.args.data = params.data\n        self.args.schema = params.schema\n\n        results = self.run()\n        return results\n", "path": "core/dbt/task/remote.py"}], "after_files": [{"content": "import signal\nimport threading\nfrom dataclasses import dataclass\nfrom datetime import datetime\nfrom typing import Union, List, Optional\n\nfrom hologram import JsonSchemaMixin\n\nfrom dbt.adapters.factory import get_adapter\nfrom dbt.clients.jinja import extract_toplevel_blocks\nfrom dbt.compilation import compile_manifest\nfrom dbt.parser.results import ParseResult\nfrom dbt.parser.rpc import RPCCallParser, RPCMacroParser\nfrom dbt.parser.util import ParserUtils\nimport dbt.ui.printer\nfrom dbt.logger import GLOBAL_LOGGER as logger\nfrom dbt.rpc.node_runners import RPCCompileRunner, RPCExecuteRunner\nfrom dbt.rpc.task import RemoteCallableResult, RPCTask\n\nfrom dbt.task.run import RunTask\nfrom dbt.task.seed import SeedTask\nfrom dbt.task.test import TestTask\n\n\n@dataclass\nclass RPCExecParameters(JsonSchemaMixin):\n    name: str\n    sql: str\n    macros: Optional[str]\n\n\n@dataclass\nclass RPCCompileProjectParameters(JsonSchemaMixin):\n    models: Union[None, str, List[str]] = None\n    exclude: Union[None, str, List[str]] = None\n\n\n@dataclass\nclass RPCTestProjectParameters(RPCCompileProjectParameters):\n    data: bool = False\n    schema: bool = False\n\n\n@dataclass\nclass RPCSeedProjectParameters(JsonSchemaMixin):\n    show: bool = False\n\n\nclass _RPCExecTask(RPCTask):\n    def __init__(self, args, config, manifest):\n        super().__init__(args, config)\n        self._base_manifest = manifest.deepcopy(config=config)\n\n    def runtime_cleanup(self, selected_uids):\n        \"\"\"Do some pre-run cleanup that is usually performed in Task __init__.\n        \"\"\"\n        self.run_count = 0\n        self.num_nodes = len(selected_uids)\n        self.node_results = []\n        self._skipped_children = {}\n        self._skipped_children = {}\n        self._raise_next_tick = None\n\n    def _extract_request_data(self, data):\n        data = self.decode_sql(data)\n        macro_blocks = []\n        data_chunks = []\n        for block in extract_toplevel_blocks(data):\n            if block.block_type_name == 'macro':\n                macro_blocks.append(block.full_block)\n            else:\n                data_chunks.append(block.full_block)\n        macros = '\\n'.join(macro_blocks)\n        sql = ''.join(data_chunks)\n        return sql, macros\n\n    def _get_exec_node(self, name, sql, macros):\n        results = ParseResult.rpc()\n        macro_overrides = {}\n        sql, macros = self._extract_request_data(sql)\n\n        if macros:\n            macro_parser = RPCMacroParser(results, self.config)\n            for node in macro_parser.parse_remote(macros):\n                macro_overrides[node.unique_id] = node\n\n        self._base_manifest.macros.update(macro_overrides)\n        rpc_parser = RPCCallParser(\n            results=results,\n            project=self.config,\n            root_project=self.config,\n            macro_manifest=self._base_manifest,\n        )\n        node = rpc_parser.parse_remote(sql, name)\n        self.manifest = ParserUtils.add_new_refs(\n            manifest=self._base_manifest,\n            current_project=self.config,\n            node=node,\n            macros=macro_overrides\n        )\n\n        # don't write our new, weird manifest!\n        self.linker = compile_manifest(self.config, self.manifest, write=False)\n        return node\n\n    def _raise_set_error(self):\n        if self._raise_next_tick is not None:\n            raise self._raise_next_tick\n\n    def _in_thread(self, node, thread_done):\n        runner = self.get_runner(node)\n        try:\n            self.node_results.append(runner.safe_run(self.manifest))\n        except Exception as exc:\n            logger.debug('Got exception {}'.format(exc), exc_info=True)\n            self._raise_next_tick = exc\n        finally:\n            thread_done.set()\n\n    def handle_request(\n        self, params: RPCExecParameters\n    ) -> RemoteCallableResult:\n        # we could get a ctrl+c at any time, including during parsing.\n        thread = None\n        started = datetime.utcnow()\n        try:\n            node = self._get_exec_node(params.name, params.sql, params.macros)\n\n            selected_uids = [node.unique_id]\n            self.runtime_cleanup(selected_uids)\n\n            thread_done = threading.Event()\n            thread = threading.Thread(target=self._in_thread,\n                                      args=(node, thread_done))\n            thread.start()\n            thread_done.wait()\n        except KeyboardInterrupt:\n            adapter = get_adapter(self.config)\n            if adapter.is_cancelable():\n\n                for conn_name in adapter.cancel_open_connections():\n                    logger.debug('canceled query {}'.format(conn_name))\n                if thread:\n                    thread.join()\n            else:\n                msg = (\"The {} adapter does not support query \"\n                       \"cancellation. Some queries may still be \"\n                       \"running!\".format(adapter.type()))\n\n                logger.debug(msg)\n\n            raise dbt.exceptions.RPCKilledException(signal.SIGINT)\n\n        self._raise_set_error()\n\n        ended = datetime.utcnow()\n        elapsed = (ended - started).total_seconds()\n        return self.get_result(\n            results=self.node_results,\n            elapsed_time=elapsed,\n            generated_at=ended,\n        )\n\n\nclass RemoteCompileTask(_RPCExecTask):\n    METHOD_NAME = 'compile_sql'\n\n    def get_runner_type(self):\n        return RPCCompileRunner\n\n\nclass RemoteRunTask(_RPCExecTask, RunTask):\n    METHOD_NAME = 'run_sql'\n\n    def get_runner_type(self):\n        return RPCExecuteRunner\n\n\nclass RemoteCompileProjectTask(RPCTask):\n    METHOD_NAME = 'compile'\n\n    def __init__(self, args, config, manifest):\n        super().__init__(args, config)\n        self.manifest = manifest.deepcopy(config=config)\n\n    def load_manifest(self):\n        # we started out with a manifest!\n        pass\n\n    def handle_request(\n        self, params: RPCCompileProjectParameters\n    ) -> RemoteCallableResult:\n        self.args.models = self._listify(params.models)\n        self.args.exclude = self._listify(params.exclude)\n\n        results = self.run()\n        return results\n\n\nclass RemoteRunProjectTask(RPCTask, RunTask):\n    METHOD_NAME = 'run'\n\n    def __init__(self, args, config, manifest):\n        super().__init__(args, config)\n        self.manifest = manifest.deepcopy(config=config)\n\n    def load_manifest(self):\n        # we started out with a manifest!\n        pass\n\n    def handle_request(\n        self, params: RPCCompileProjectParameters\n    ) -> RemoteCallableResult:\n        self.args.models = self._listify(params.models)\n        self.args.exclude = self._listify(params.exclude)\n\n        results = self.run()\n        return results\n\n\nclass RemoteSeedProjectTask(RPCTask, SeedTask):\n    METHOD_NAME = 'seed'\n\n    def __init__(self, args, config, manifest):\n        super().__init__(args, config)\n        self.manifest = manifest.deepcopy(config=config)\n\n    def load_manifest(self):\n        # we started out with a manifest!\n        pass\n\n    def handle_request(\n        self, params: RPCSeedProjectParameters\n    ) -> RemoteCallableResult:\n        self.args.show = params.show\n\n        results = self.run()\n        return results\n\n\nclass RemoteTestProjectTask(RPCTask, TestTask):\n    METHOD_NAME = 'test'\n\n    def __init__(self, args, config, manifest):\n        super().__init__(args, config)\n        self.manifest = manifest.deepcopy(config=config)\n\n    def load_manifest(self):\n        # we started out with a manifest!\n        pass\n\n    def handle_request(\n        self, params: RPCTestProjectParameters,\n    ) -> RemoteCallableResult:\n        self.args.models = self._listify(params.models)\n        self.args.exclude = self._listify(params.exclude)\n        self.args.data = params.data\n        self.args.schema = params.schema\n\n        results = self.run()\n        return results\n", "path": "core/dbt/task/remote.py"}]}