Skip to content

Commit

Permalink
Fix #10988: Validate manifest has group_map during group_lookup init
Browse files Browse the repository at this point in the history
  • Loading branch information
aranke committed Nov 13, 2024
1 parent 89caa33 commit d02766d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .changes/unreleased/Fixes-20241113-171516.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Fixes
body: Validate manifest has group_map during group_lookup init
time: 2024-11-13T17:15:16.176082Z
custom:
Author: aranke
Issue: "10988"
3 changes: 3 additions & 0 deletions core/dbt/task/group_lookup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ def init(manifest: Optional[Manifest], selected_ids: AbstractSet[str]) -> None:
if not manifest:
return

if not manifest.groups:
return

Check warning on line 15 in core/dbt/task/group_lookup.py

View check run for this annotation

Codecov / codecov/patch

core/dbt/task/group_lookup.py#L14-L15

Added lines #L14 - L15 were not covered by tests

_every_group_name_to_group_map = {v.name: v for v in manifest.groups.values()}

for group_name, node_ids in manifest.group_map.items():
Expand Down
12 changes: 12 additions & 0 deletions tests/functional/logging/test_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,3 +277,15 @@ def test_node_info_on_results(self, project, logs_dir):
run_result_warning_count += 1

assert run_result_warning_count == 1


class TestRunResultNoGroup:
@pytest.fixture(scope="class")
def models(self):
return {
"my_model.sql": "select 1 as id",
}

def test_node_info_on_results(self, project, logs_dir):
results = run_dbt(["--no-write-json", "run"])
assert len(results) == 1

0 comments on commit d02766d

Please sign in to comment.