1+ #!/usr/bin/env python3
2+ from pathlib import Path
3+ from sqlmesh .dbt .context import DbtContext
4+
5+ # Initialize the context for the sushi_test project
6+ context = DbtContext (project_root = Path ("tests/fixtures/dbt/sushi_test" ))
7+
8+ # Get the manifest
9+ manifest = context ._manifest
10+ if manifest and hasattr (manifest , '_manifest' ):
11+ nodes = manifest ._manifest .nodes
12+
13+ print ("=== Checking node descriptions ===" )
14+ for node_name , node in nodes .items ():
15+ if 'top_waiters' in node_name or ('waiters' in node_name and 'waiter_' not in node_name ):
16+ print (f'\n Node: { node_name } ' )
17+ print (f' Has description attr: { hasattr (node , "description" )} ' )
18+ if hasattr (node , "description" ):
19+ print (f' description value: { node .description !r} ' )
20+
21+ if hasattr (node , 'to_dict' ):
22+ node_dict = node .to_dict ()
23+ print (f' description in dict: { "description" in node_dict } ' )
24+ if "description" in node_dict :
25+ print (f' dict description value: { node_dict ["description" ]!r} ' )
26+
27+ if hasattr (node , 'config' ):
28+ config_dict = node .config .to_dict ()
29+ print (f' description in config: { "description" in config_dict } ' )
30+ if "description" in config_dict :
31+ print (f' config description value: { config_dict ["description" ]!r} ' )
32+
33+ # Now check the loaded models
34+ print ("\n === Checking loaded models ===" )
35+ models = manifest .models () if manifest else {}
36+ for name , model in models .items ():
37+ if name == 'top_waiters' or name == 'waiters' :
38+ print (f'\n Model: { name } ' )
39+ print (f' description: { model .description !r} ' )
0 commit comments