Skip to content

Commit

Permalink
Use Manifest instead of ParseResults [#3163]
Browse files Browse the repository at this point in the history
  • Loading branch information
gshank committed Apr 6, 2021
1 parent 6acd4b9 commit a132540
Show file tree
Hide file tree
Showing 30 changed files with 884 additions and 887 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -24,6 +24,7 @@
- Bump `snowflake-connector-python` and releated dependencies, support Python 3.9 ([#2985](https://github.com/fishtown-analytics/dbt/issues/2985), [#3148](https://github.com/fishtown-analytics/dbt/pull/3148))
- General development environment clean up and improve experience running tests locally ([#3194](https://github.com/fishtown-analytics/dbt/issues/3194), [#3204](https://github.com/fishtown-analytics/dbt/pull/3204))
- Add a new materialization for tests, update data tests to use test materialization when executing. ([#3154](https://github.com/fishtown-analytics/dbt/issues/3154), [#3181](https://github.com/fishtown-analytics/dbt/pull/3181))
- Switch from externally storing parsing state in ParseResult object to using Manifest ([#3163](http://github.com/fishtown-analytics/dbt/issues/3163), [#3219](https://github.com/fishtown-analytics/dbt/pull/3219))

Contributors:
- [@yu-iskw](https://github.com/yu-iskw) ([#2928](https://github.com/fishtown-analytics/dbt/pull/2928))
Expand Down
4 changes: 2 additions & 2 deletions core/dbt/adapters/base/impl.py
Expand Up @@ -273,8 +273,8 @@ def check_macro_manifest(self) -> Optional[MacroManifest]:
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(
from dbt.parser.manifest import ManifestLoader
manifest = ManifestLoader.load_macros(
self.config, self.connections.set_query_header
)
self._macro_manifest_lazy = manifest
Expand Down
4 changes: 2 additions & 2 deletions core/dbt/context/manifest.py
Expand Up @@ -2,7 +2,7 @@

from dbt.clients.jinja import MacroStack
from dbt.contracts.connection import AdapterRequiredConfig
from dbt.contracts.graph.manifest import Manifest, AnyManifest
from dbt.contracts.graph.manifest import Manifest
from dbt.context.macro_resolver import TestMacroNamespace


Expand All @@ -20,7 +20,7 @@ class ManifestContext(ConfiguredContext):
def __init__(
self,
config: AdapterRequiredConfig,
manifest: AnyManifest,
manifest: Manifest,
search_package: str,
) -> None:
super().__init__(config)
Expand Down
10 changes: 5 additions & 5 deletions core/dbt/context/providers.py
Expand Up @@ -20,7 +20,7 @@
from .manifest import ManifestContext
from dbt.contracts.connection import AdapterResponse
from dbt.contracts.graph.manifest import (
Manifest, AnyManifest, Disabled, MacroManifest
Manifest, Disabled
)
from dbt.contracts.graph.compiled import (
CompiledResource,
Expand Down Expand Up @@ -1210,7 +1210,7 @@ def __init__(
self,
model: ParsedMacro,
config: RuntimeConfig,
manifest: AnyManifest,
manifest: Manifest,
provider: Provider,
search_package: Optional[str],
) -> None:
Expand Down Expand Up @@ -1300,7 +1300,7 @@ def this(self) -> Optional[RelationProxy]:
def generate_parser_model(
model: ManifestNode,
config: RuntimeConfig,
manifest: MacroManifest,
manifest: Manifest,
context_config: ContextConfig,
) -> Dict[str, Any]:
# The __init__ method of ModelContext also initializes
Expand All @@ -1317,7 +1317,7 @@ def generate_parser_model(
def generate_generate_component_name_macro(
macro: ParsedMacro,
config: RuntimeConfig,
manifest: MacroManifest,
manifest: Manifest,
) -> Dict[str, Any]:
ctx = MacroContext(
macro, config, manifest, GenerateNameProvider(), None
Expand Down Expand Up @@ -1370,7 +1370,7 @@ def __call__(self, *args) -> str:
def generate_parse_exposure(
exposure: ParsedExposure,
config: RuntimeConfig,
manifest: MacroManifest,
manifest: Manifest,
package_name: str,
) -> Dict[str, Any]:
project = config.load_dependencies()[package_name]
Expand Down

0 comments on commit a132540

Please sign in to comment.