Skip to content

Commit

Permalink
Merge pull request #3219 from fishtown-analytics/partial_parsing
Browse files Browse the repository at this point in the history
Use Manifest instead of ParseResult [#3163]
  • Loading branch information
gshank authored Apr 6, 2021
2 parents 6acd4b9 + 307d47e commit 749f873
Show file tree
Hide file tree
Showing 30 changed files with 885 additions and 887 deletions.
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](https://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

0 comments on commit 749f873

Please sign in to comment.