diff --git a/.changes/unreleased/Under the Hood-20230725-102609.yaml b/.changes/unreleased/Under the Hood-20230725-102609.yaml new file mode 100644 index 00000000000..f4cf4aec5cc --- /dev/null +++ b/.changes/unreleased/Under the Hood-20230725-102609.yaml @@ -0,0 +1,7 @@ +kind: Under the Hood +body: Ref expressions with version can now be processed by the latest version of the + high-performance dbt-extractor library. +time: 2023-07-25T10:26:09.902878-04:00 +custom: + Author: peterallenwebb + Issue: "7688" diff --git a/core/dbt/parser/models.py b/core/dbt/parser/models.py index 772ed5f0640..4fe6cd56082 100644 --- a/core/dbt/parser/models.py +++ b/core/dbt/parser/models.py @@ -497,12 +497,10 @@ def populate(self, node: ModelNode, config: ContextConfig, statically_parsed: Di # set refs and sources on the node object refs: List[RefArgs] = [] for ref in statically_parsed["refs"]: - if len(ref) == 1: - package, name = None, ref[0] - else: - package, name = ref - - refs.append(RefArgs(package=package, name=name)) + name = ref.get("name") + package = ref.get("package") + version = ref.get("version") + refs.append(RefArgs(name, package, version)) node.refs += refs node.sources += statically_parsed["sources"] diff --git a/core/setup.py b/core/setup.py index e99a1ba715b..c43cc6997fd 100644 --- a/core/setup.py +++ b/core/setup.py @@ -73,7 +73,7 @@ "sqlparse>=0.2.3", # ---- # These are major-version-0 packages also maintained by dbt-labs. Accept patches. - "dbt-extractor~=0.4.1", + "dbt-extractor~=0.5.0", "hologram~=0.0.16", # includes transitive dependencies on python-dateutil and jsonschema "minimal-snowplow-tracker~=0.0.2", # DSI is under active development, so we're pinning to specific dev versions for now.