Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Manifest instead of ParseResult [#3163] #3219

Merged
merged 1 commit into from
Apr 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Loading