File tree Expand file tree Collapse file tree 3 files changed +34
-0
lines changed
fixtures/dbt/sushi_test/models Expand file tree Collapse file tree 3 files changed +34
-0
lines changed Original file line number Diff line number Diff line change 1+ from pathlib import Path
2+ import pytest
3+
4+ from sqlmesh .core .config .model import ModelDefaultsConfig
5+ from sqlmesh .dbt .context import DbtContext
6+ from sqlmesh .dbt .manifest import ManifestHelper
7+ from sqlmesh .dbt .profile import Profile
8+
9+
10+ pytestmark = pytest .mark .dbt
11+
12+
13+ @pytest .mark .xdist_group ("dbt_manifest" )
14+ def test_docs_inline ():
15+ project_path = Path ("tests/fixtures/dbt/sushi_test" )
16+ profile = Profile .load (DbtContext (project_path ))
17+
18+ helper = ManifestHelper (
19+ project_path ,
20+ project_path ,
21+ "sushi" ,
22+ profile .target ,
23+ model_defaults = ModelDefaultsConfig (start = "2020-01-01" ),
24+ )
25+ # Inline description in yaml
26+ assert helper .models ()["waiters" ].description == "waiters docs block"
27+ # Docs block from .md file
28+ assert helper .models ()["top_waiters" ].description == "description of top waiters"
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ version: 2
22
33models :
44 - name : top_waiters
5+ description : description of top waiters
56 columns :
67 - name : waiter_id
78 data_type : int
@@ -18,6 +19,7 @@ models:
1819 warn_after : {count: 8, period: hour}
1920 error_after : {count: 9, period: hour}
2021 - name : waiters
22+ description : ' {{ doc("waiters") }}'
2123 - name : waiter_as_customer_by_day
2224 - name : waiter_revenue_by_day
2325 versions :
Original file line number Diff line number Diff line change 1+ {% docs waiters %}
2+ waiters docs block
3+ {% enddocs %}
4+
You can’t perform that action at this time.
0 commit comments