Skip to content

Commit

Permalink
[#3764] Fix bug in analysis patch application
Browse files Browse the repository at this point in the history
  • Loading branch information
gshank committed Aug 17, 2021
1 parent 2980cd1 commit 85cac03
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/dbt/contracts/graph/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def perform_lookup(


class AnalysisLookup(RefableLookup):
_lookup_types: ClassVar[set] = set(NodeType.Analysis)
_lookup_types: ClassVar[set] = set([NodeType.Analysis])


def _search_packages(
Expand Down
5 changes: 5 additions & 0 deletions test/integration/019_analysis_tests/analysis/schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
version: 2

analyses:
- name: analysis
description: "This is my analysis"
7 changes: 6 additions & 1 deletion test/integration/019_analysis_tests/test_analyses.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from test.integration.base import DBTIntegrationTest, use_profile
from test.integration.base import DBTIntegrationTest, use_profile, get_manifest
import os


Expand Down Expand Up @@ -36,6 +36,11 @@ def test_postgres_analyses(self):
self.assertFalse(os.path.exists(compiled_analysis_path))
results = self.run_dbt(["compile"])
self.assertEqual(len(results), 3)
manifest = get_manifest()
analysis_id = 'analysis.test.analysis'
self.assertIn(analysis_id, manifest.nodes)
node = manifest.nodes[analysis_id]
self.assertEqual(node.description, 'This is my analysis')

self.assertTrue(os.path.exists(path_1))
self.assertTrue(os.path.exists(path_2))
Expand Down

0 comments on commit 85cac03

Please sign in to comment.