We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
BigQuery project alias is ignored in config
### Describe the bug
A user reported that a config like:
```
{{ config(project='myproject') }}

...
```

has regressed in dbt v0.17.0. While this config worked in a BQ project in dbt v0.16.1, they reported that they needed to change `project` to `database` to apply the configuration in dbt v0.17.0.

This issue needs to be reproduced - there may be other factors that impact the incidence of this regression.

### Steps To Reproduce
```
-- models/my_model.sql

{{ config(project='custom_project') }}

select 1 as id
```

```
dbt run
```

Confirm that the model was _not_ build into the custom project override

### Expected behavior
The model should be built into the project defined in the `project` config. Database-specific aliases should applied to config names.

### System information
**Which database are you using dbt with?**
- [x] bigquery


**The output of `dbt --version`:**
```
0.17.0
```

**The operating system you're using:** Windows
**The output of `python --version`:** Unknown

--- 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/context/context_config.py`
Content:
```
1 from copy import deepcopy
2 from dataclasses import dataclass
3 from typing import List, Iterator, Dict, Any, TypeVar, Union
4 
5 from dbt.config import RuntimeConfig, Project
6 from dbt.contracts.graph.model_config import BaseConfig, get_config_for
7 from dbt.exceptions import InternalException
8 from dbt.legacy_config_updater import ConfigUpdater, IsFQNResource
9 from dbt.node_types import NodeType
10 from dbt.utils import fqn_search
11 
12 
13 @dataclass
14 class ModelParts(IsFQNResource):
15     fqn: List[str]
16     resource_type: NodeType
17     package_name: str
18 
19 
20 class LegacyContextConfig:
21     def __init__(
22         self,
23         active_project: RuntimeConfig,
24         own_project: Project,
25         fqn: List[str],
26         node_type: NodeType,
27     ):
28         self._config = None
29         self.active_project: RuntimeConfig = active_project
30         self.own_project: Project = own_project
31 
32         self.model = ModelParts(
33             fqn=fqn,
34             resource_type=node_type,
35             package_name=self.own_project.project_name,
36         )
37 
38         self.updater = ConfigUpdater(active_project.credentials.type)
39 
40         # the config options defined within the model
41         self.in_model_config: Dict[str, Any] = {}
42 
43     def get_default(self) -> Dict[str, Any]:
44         defaults = {"enabled": True, "materialized": "view"}
45 
46         if self.model.resource_type == NodeType.Seed:
47             defaults['materialized'] = 'seed'
48         elif self.model.resource_type == NodeType.Snapshot:
49             defaults['materialized'] = 'snapshot'
50 
51         if self.model.resource_type == NodeType.Test:
52             defaults['severity'] = 'ERROR'
53 
54         return defaults
55 
56     def build_config_dict(self, base: bool = False) -> Dict[str, Any]:
57         defaults = self.get_default()
58         active_config = self.load_config_from_active_project()
59 
60         if self.active_project.project_name == self.own_project.project_name:
61             cfg = self.updater.merge(
62                 defaults, active_config, self.in_model_config
63             )
64         else:
65             own_config = self.load_config_from_own_project()
66 
67             cfg = self.updater.merge(
68                 defaults, own_config, self.in_model_config, active_config
69             )
70 
71         return cfg
72 
73     def _translate_adapter_aliases(self, config: Dict[str, Any]):
74         return self.active_project.credentials.translate_aliases(config)
75 
76     def update_in_model_config(self, config: Dict[str, Any]) -> None:
77         config = self._translate_adapter_aliases(config)
78         self.updater.update_into(self.in_model_config, config)
79 
80     def load_config_from_own_project(self) -> Dict[str, Any]:
81         return self.updater.get_project_config(self.model, self.own_project)
82 
83     def load_config_from_active_project(self) -> Dict[str, Any]:
84         return self.updater.get_project_config(self.model, self.active_project)
85 
86 
87 T = TypeVar('T', bound=BaseConfig)
88 
89 
90 class ContextConfigGenerator:
91     def __init__(self, active_project: RuntimeConfig):
92         self.active_project = active_project
93 
94     def get_node_project(self, project_name: str):
95         if project_name == self.active_project.project_name:
96             return self.active_project
97         dependencies = self.active_project.load_dependencies()
98         if project_name not in dependencies:
99             raise InternalException(
100                 f'Project name {project_name} not found in dependencies '
101                 f'(found {list(dependencies)})'
102             )
103         return dependencies[project_name]
104 
105     def project_configs(
106         self, project: Project, fqn: List[str], resource_type: NodeType
107     ) -> Iterator[Dict[str, Any]]:
108         if resource_type == NodeType.Seed:
109             model_configs = project.seeds
110         elif resource_type == NodeType.Snapshot:
111             model_configs = project.snapshots
112         elif resource_type == NodeType.Source:
113             model_configs = project.sources
114         else:
115             model_configs = project.models
116         for level_config in fqn_search(model_configs, fqn):
117             result = {}
118             for key, value in level_config.items():
119                 if key.startswith('+'):
120                     result[key[1:]] = deepcopy(value)
121                 elif not isinstance(value, dict):
122                     result[key] = deepcopy(value)
123 
124             yield result
125 
126     def active_project_configs(
127         self, fqn: List[str], resource_type: NodeType
128     ) -> Iterator[Dict[str, Any]]:
129         return self.project_configs(self.active_project, fqn, resource_type)
130 
131     def _update_from_config(
132         self, result: T, partial: Dict[str, Any], validate: bool = False
133     ) -> T:
134         return result.update_from(
135             partial,
136             self.active_project.credentials.type,
137             validate=validate
138         )
139 
140     def calculate_node_config(
141         self,
142         config_calls: List[Dict[str, Any]],
143         fqn: List[str],
144         resource_type: NodeType,
145         project_name: str,
146         base: bool,
147     ) -> BaseConfig:
148         own_config = self.get_node_project(project_name)
149         # defaults, own_config, config calls, active_config (if != own_config)
150         config_cls = get_config_for(resource_type, base=base)
151         # Calculate the defaults. We don't want to validate the defaults,
152         # because it might be invalid in the case of required config members
153         # (such as on snapshots!)
154         result = config_cls.from_dict({}, validate=False)
155         for fqn_config in self.project_configs(own_config, fqn, resource_type):
156             result = self._update_from_config(result, fqn_config)
157         for config_call in config_calls:
158             result = self._update_from_config(result, config_call)
159 
160         if own_config.project_name != self.active_project.project_name:
161             for fqn_config in self.active_project_configs(fqn, resource_type):
162                 result = self._update_from_config(result, fqn_config)
163 
164         # this is mostly impactful in the snapshot config case
165         return result.finalize_and_validate()
166 
167 
168 class ContextConfig:
169     def __init__(
170         self,
171         active_project: RuntimeConfig,
172         fqn: List[str],
173         resource_type: NodeType,
174         project_name: str,
175     ) -> None:
176         self.config_calls: List[Dict[str, Any]] = []
177         self.cfg_source = ContextConfigGenerator(active_project)
178         self.fqn = fqn
179         self.resource_type = resource_type
180         self.project_name = project_name
181 
182     def update_in_model_config(self, opts: Dict[str, Any]) -> None:
183         self.config_calls.append(opts)
184 
185     def build_config_dict(self, base: bool = False) -> Dict[str, Any]:
186         return self.cfg_source.calculate_node_config(
187             config_calls=self.config_calls,
188             fqn=self.fqn,
189             resource_type=self.resource_type,
190             project_name=self.project_name,
191             base=base,
192         ).to_dict()
193 
194 
195 ContextConfigType = Union[LegacyContextConfig, ContextConfig]
196
```
--- 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/context/context_config.py b/core/dbt/context/context_config.py
--- a/core/dbt/context/context_config.py
+++ b/core/dbt/context/context_config.py
@@ -131,8 +131,9 @@
     def _update_from_config(
         self, result: T, partial: Dict[str, Any], validate: bool = False
     ) -> T:
+        translated = self.active_project.credentials.translate_aliases(partial)
         return result.update_from(
-            partial,
+            translated,
             self.active_project.credentials.type,
             validate=validate
         )

{"golden_diff": "diff --git a/core/dbt/context/context_config.py b/core/dbt/context/context_config.py\n--- a/core/dbt/context/context_config.py\n+++ b/core/dbt/context/context_config.py\n@@ -131,8 +131,9 @@\n     def _update_from_config(\n         self, result: T, partial: Dict[str, Any], validate: bool = False\n     ) -> T:\n+        translated = self.active_project.credentials.translate_aliases(partial)\n         return result.update_from(\n-            partial,\n+            translated,\n             self.active_project.credentials.type,\n             validate=validate\n         )\n", "issue": "BigQuery project alias is ignored in config\n### Describe the bug\r\nA user reported that a config like:\r\n```\r\n{{ config(project='myproject') }}\r\n\r\n...\r\n```\r\n\r\nhas regressed in dbt v0.17.0. While this config worked in a BQ project in dbt v0.16.1, they reported that they needed to change `project` to `database` to apply the configuration in dbt v0.17.0.\r\n\r\nThis issue needs to be reproduced - there may be other factors that impact the incidence of this regression.\r\n\r\n### Steps To Reproduce\r\n```\r\n-- models/my_model.sql\r\n\r\n{{ config(project='custom_project') }}\r\n\r\nselect 1 as id\r\n```\r\n\r\n```\r\ndbt run\r\n```\r\n\r\nConfirm that the model was _not_ build into the custom project override\r\n\r\n### Expected behavior\r\nThe model should be built into the project defined in the `project` config. Database-specific aliases should applied to config names.\r\n\r\n### System information\r\n**Which database are you using dbt with?**\r\n- [x] bigquery\r\n\r\n\r\n**The output of `dbt --version`:**\r\n```\r\n0.17.0\r\n```\r\n\r\n**The operating system you're using:** Windows\r\n**The output of `python --version`:** Unknown\n", "before_files": [{"content": "from copy import deepcopy\nfrom dataclasses import dataclass\nfrom typing import List, Iterator, Dict, Any, TypeVar, Union\n\nfrom dbt.config import RuntimeConfig, Project\nfrom dbt.contracts.graph.model_config import BaseConfig, get_config_for\nfrom dbt.exceptions import InternalException\nfrom dbt.legacy_config_updater import ConfigUpdater, IsFQNResource\nfrom dbt.node_types import NodeType\nfrom dbt.utils import fqn_search\n\n\n@dataclass\nclass ModelParts(IsFQNResource):\n    fqn: List[str]\n    resource_type: NodeType\n    package_name: str\n\n\nclass LegacyContextConfig:\n    def __init__(\n        self,\n        active_project: RuntimeConfig,\n        own_project: Project,\n        fqn: List[str],\n        node_type: NodeType,\n    ):\n        self._config = None\n        self.active_project: RuntimeConfig = active_project\n        self.own_project: Project = own_project\n\n        self.model = ModelParts(\n            fqn=fqn,\n            resource_type=node_type,\n            package_name=self.own_project.project_name,\n        )\n\n        self.updater = ConfigUpdater(active_project.credentials.type)\n\n        # the config options defined within the model\n        self.in_model_config: Dict[str, Any] = {}\n\n    def get_default(self) -> Dict[str, Any]:\n        defaults = {\"enabled\": True, \"materialized\": \"view\"}\n\n        if self.model.resource_type == NodeType.Seed:\n            defaults['materialized'] = 'seed'\n        elif self.model.resource_type == NodeType.Snapshot:\n            defaults['materialized'] = 'snapshot'\n\n        if self.model.resource_type == NodeType.Test:\n            defaults['severity'] = 'ERROR'\n\n        return defaults\n\n    def build_config_dict(self, base: bool = False) -> Dict[str, Any]:\n        defaults = self.get_default()\n        active_config = self.load_config_from_active_project()\n\n        if self.active_project.project_name == self.own_project.project_name:\n            cfg = self.updater.merge(\n                defaults, active_config, self.in_model_config\n            )\n        else:\n            own_config = self.load_config_from_own_project()\n\n            cfg = self.updater.merge(\n                defaults, own_config, self.in_model_config, active_config\n            )\n\n        return cfg\n\n    def _translate_adapter_aliases(self, config: Dict[str, Any]):\n        return self.active_project.credentials.translate_aliases(config)\n\n    def update_in_model_config(self, config: Dict[str, Any]) -> None:\n        config = self._translate_adapter_aliases(config)\n        self.updater.update_into(self.in_model_config, config)\n\n    def load_config_from_own_project(self) -> Dict[str, Any]:\n        return self.updater.get_project_config(self.model, self.own_project)\n\n    def load_config_from_active_project(self) -> Dict[str, Any]:\n        return self.updater.get_project_config(self.model, self.active_project)\n\n\nT = TypeVar('T', bound=BaseConfig)\n\n\nclass ContextConfigGenerator:\n    def __init__(self, active_project: RuntimeConfig):\n        self.active_project = active_project\n\n    def get_node_project(self, project_name: str):\n        if project_name == self.active_project.project_name:\n            return self.active_project\n        dependencies = self.active_project.load_dependencies()\n        if project_name not in dependencies:\n            raise InternalException(\n                f'Project name {project_name} not found in dependencies '\n                f'(found {list(dependencies)})'\n            )\n        return dependencies[project_name]\n\n    def project_configs(\n        self, project: Project, fqn: List[str], resource_type: NodeType\n    ) -> Iterator[Dict[str, Any]]:\n        if resource_type == NodeType.Seed:\n            model_configs = project.seeds\n        elif resource_type == NodeType.Snapshot:\n            model_configs = project.snapshots\n        elif resource_type == NodeType.Source:\n            model_configs = project.sources\n        else:\n            model_configs = project.models\n        for level_config in fqn_search(model_configs, fqn):\n            result = {}\n            for key, value in level_config.items():\n                if key.startswith('+'):\n                    result[key[1:]] = deepcopy(value)\n                elif not isinstance(value, dict):\n                    result[key] = deepcopy(value)\n\n            yield result\n\n    def active_project_configs(\n        self, fqn: List[str], resource_type: NodeType\n    ) -> Iterator[Dict[str, Any]]:\n        return self.project_configs(self.active_project, fqn, resource_type)\n\n    def _update_from_config(\n        self, result: T, partial: Dict[str, Any], validate: bool = False\n    ) -> T:\n        return result.update_from(\n            partial,\n            self.active_project.credentials.type,\n            validate=validate\n        )\n\n    def calculate_node_config(\n        self,\n        config_calls: List[Dict[str, Any]],\n        fqn: List[str],\n        resource_type: NodeType,\n        project_name: str,\n        base: bool,\n    ) -> BaseConfig:\n        own_config = self.get_node_project(project_name)\n        # defaults, own_config, config calls, active_config (if != own_config)\n        config_cls = get_config_for(resource_type, base=base)\n        # Calculate the defaults. We don't want to validate the defaults,\n        # because it might be invalid in the case of required config members\n        # (such as on snapshots!)\n        result = config_cls.from_dict({}, validate=False)\n        for fqn_config in self.project_configs(own_config, fqn, resource_type):\n            result = self._update_from_config(result, fqn_config)\n        for config_call in config_calls:\n            result = self._update_from_config(result, config_call)\n\n        if own_config.project_name != self.active_project.project_name:\n            for fqn_config in self.active_project_configs(fqn, resource_type):\n                result = self._update_from_config(result, fqn_config)\n\n        # this is mostly impactful in the snapshot config case\n        return result.finalize_and_validate()\n\n\nclass ContextConfig:\n    def __init__(\n        self,\n        active_project: RuntimeConfig,\n        fqn: List[str],\n        resource_type: NodeType,\n        project_name: str,\n    ) -> None:\n        self.config_calls: List[Dict[str, Any]] = []\n        self.cfg_source = ContextConfigGenerator(active_project)\n        self.fqn = fqn\n        self.resource_type = resource_type\n        self.project_name = project_name\n\n    def update_in_model_config(self, opts: Dict[str, Any]) -> None:\n        self.config_calls.append(opts)\n\n    def build_config_dict(self, base: bool = False) -> Dict[str, Any]:\n        return self.cfg_source.calculate_node_config(\n            config_calls=self.config_calls,\n            fqn=self.fqn,\n            resource_type=self.resource_type,\n            project_name=self.project_name,\n            base=base,\n        ).to_dict()\n\n\nContextConfigType = Union[LegacyContextConfig, ContextConfig]\n", "path": "core/dbt/context/context_config.py"}], "after_files": [{"content": "from copy import deepcopy\nfrom dataclasses import dataclass\nfrom typing import List, Iterator, Dict, Any, TypeVar, Union\n\nfrom dbt.config import RuntimeConfig, Project\nfrom dbt.contracts.graph.model_config import BaseConfig, get_config_for\nfrom dbt.exceptions import InternalException\nfrom dbt.legacy_config_updater import ConfigUpdater, IsFQNResource\nfrom dbt.node_types import NodeType\nfrom dbt.utils import fqn_search\n\n\n@dataclass\nclass ModelParts(IsFQNResource):\n    fqn: List[str]\n    resource_type: NodeType\n    package_name: str\n\n\nclass LegacyContextConfig:\n    def __init__(\n        self,\n        active_project: RuntimeConfig,\n        own_project: Project,\n        fqn: List[str],\n        node_type: NodeType,\n    ):\n        self._config = None\n        self.active_project: RuntimeConfig = active_project\n        self.own_project: Project = own_project\n\n        self.model = ModelParts(\n            fqn=fqn,\n            resource_type=node_type,\n            package_name=self.own_project.project_name,\n        )\n\n        self.updater = ConfigUpdater(active_project.credentials.type)\n\n        # the config options defined within the model\n        self.in_model_config: Dict[str, Any] = {}\n\n    def get_default(self) -> Dict[str, Any]:\n        defaults = {\"enabled\": True, \"materialized\": \"view\"}\n\n        if self.model.resource_type == NodeType.Seed:\n            defaults['materialized'] = 'seed'\n        elif self.model.resource_type == NodeType.Snapshot:\n            defaults['materialized'] = 'snapshot'\n\n        if self.model.resource_type == NodeType.Test:\n            defaults['severity'] = 'ERROR'\n\n        return defaults\n\n    def build_config_dict(self, base: bool = False) -> Dict[str, Any]:\n        defaults = self.get_default()\n        active_config = self.load_config_from_active_project()\n\n        if self.active_project.project_name == self.own_project.project_name:\n            cfg = self.updater.merge(\n                defaults, active_config, self.in_model_config\n            )\n        else:\n            own_config = self.load_config_from_own_project()\n\n            cfg = self.updater.merge(\n                defaults, own_config, self.in_model_config, active_config\n            )\n\n        return cfg\n\n    def _translate_adapter_aliases(self, config: Dict[str, Any]):\n        return self.active_project.credentials.translate_aliases(config)\n\n    def update_in_model_config(self, config: Dict[str, Any]) -> None:\n        config = self._translate_adapter_aliases(config)\n        self.updater.update_into(self.in_model_config, config)\n\n    def load_config_from_own_project(self) -> Dict[str, Any]:\n        return self.updater.get_project_config(self.model, self.own_project)\n\n    def load_config_from_active_project(self) -> Dict[str, Any]:\n        return self.updater.get_project_config(self.model, self.active_project)\n\n\nT = TypeVar('T', bound=BaseConfig)\n\n\nclass ContextConfigGenerator:\n    def __init__(self, active_project: RuntimeConfig):\n        self.active_project = active_project\n\n    def get_node_project(self, project_name: str):\n        if project_name == self.active_project.project_name:\n            return self.active_project\n        dependencies = self.active_project.load_dependencies()\n        if project_name not in dependencies:\n            raise InternalException(\n                f'Project name {project_name} not found in dependencies '\n                f'(found {list(dependencies)})'\n            )\n        return dependencies[project_name]\n\n    def project_configs(\n        self, project: Project, fqn: List[str], resource_type: NodeType\n    ) -> Iterator[Dict[str, Any]]:\n        if resource_type == NodeType.Seed:\n            model_configs = project.seeds\n        elif resource_type == NodeType.Snapshot:\n            model_configs = project.snapshots\n        elif resource_type == NodeType.Source:\n            model_configs = project.sources\n        else:\n            model_configs = project.models\n        for level_config in fqn_search(model_configs, fqn):\n            result = {}\n            for key, value in level_config.items():\n                if key.startswith('+'):\n                    result[key[1:]] = deepcopy(value)\n                elif not isinstance(value, dict):\n                    result[key] = deepcopy(value)\n\n            yield result\n\n    def active_project_configs(\n        self, fqn: List[str], resource_type: NodeType\n    ) -> Iterator[Dict[str, Any]]:\n        return self.project_configs(self.active_project, fqn, resource_type)\n\n    def _update_from_config(\n        self, result: T, partial: Dict[str, Any], validate: bool = False\n    ) -> T:\n        translated = self.active_project.credentials.translate_aliases(partial)\n        return result.update_from(\n            translated,\n            self.active_project.credentials.type,\n            validate=validate\n        )\n\n    def calculate_node_config(\n        self,\n        config_calls: List[Dict[str, Any]],\n        fqn: List[str],\n        resource_type: NodeType,\n        project_name: str,\n        base: bool,\n    ) -> BaseConfig:\n        own_config = self.get_node_project(project_name)\n        # defaults, own_config, config calls, active_config (if != own_config)\n        config_cls = get_config_for(resource_type, base=base)\n        # Calculate the defaults. We don't want to validate the defaults,\n        # because it might be invalid in the case of required config members\n        # (such as on snapshots!)\n        result = config_cls.from_dict({}, validate=False)\n        for fqn_config in self.project_configs(own_config, fqn, resource_type):\n            result = self._update_from_config(result, fqn_config)\n        for config_call in config_calls:\n            result = self._update_from_config(result, config_call)\n\n        if own_config.project_name != self.active_project.project_name:\n            for fqn_config in self.active_project_configs(fqn, resource_type):\n                result = self._update_from_config(result, fqn_config)\n\n        # this is mostly impactful in the snapshot config case\n        return result.finalize_and_validate()\n\n\nclass ContextConfig:\n    def __init__(\n        self,\n        active_project: RuntimeConfig,\n        fqn: List[str],\n        resource_type: NodeType,\n        project_name: str,\n    ) -> None:\n        self.config_calls: List[Dict[str, Any]] = []\n        self.cfg_source = ContextConfigGenerator(active_project)\n        self.fqn = fqn\n        self.resource_type = resource_type\n        self.project_name = project_name\n\n    def update_in_model_config(self, opts: Dict[str, Any]) -> None:\n        self.config_calls.append(opts)\n\n    def build_config_dict(self, base: bool = False) -> Dict[str, Any]:\n        return self.cfg_source.calculate_node_config(\n            config_calls=self.config_calls,\n            fqn=self.fqn,\n            resource_type=self.resource_type,\n            project_name=self.project_name,\n            base=base,\n        ).to_dict()\n\n\nContextConfigType = Union[LegacyContextConfig, ContextConfig]\n", "path": "core/dbt/context/context_config.py"}]}