|  | 
| 12 | 12 | 
 | 
| 13 | 13 |   -- Add models to the list | 
| 14 | 14 |   {%- for node_id, node in graph.nodes.items() -%} | 
| 15 |  | -    {%- if node.resource_type == 'model' and node.columns -%} | 
|  | 15 | +    {%- if node.resource_type == 'model' -%} | 
| 16 | 16 |       {%- do table_info.append({ | 
| 17 | 17 |         'name': node.name, | 
| 18 | 18 |         'schema': node.schema, | 
|  | 
| 24 | 24 | 
 | 
| 25 | 25 |   -- Add sources to the list | 
| 26 | 26 |   {%- for source_id, source in graph.sources.items() -%} | 
| 27 |  | -    {%- if source.columns -%} | 
| 28 |  | -      {%- do table_info.append({ | 
| 29 |  | -        'name': source.name, | 
| 30 |  | -        'schema': source.schema, | 
| 31 |  | -        'database': source.database, | 
| 32 |  | -        'type': 'source' | 
| 33 |  | -      }) -%} | 
| 34 |  | -    {%- endif -%} | 
|  | 27 | +    {%- do table_info.append({ | 
|  | 28 | +      'name': source.name, | 
|  | 29 | +      'schema': source.schema, | 
|  | 30 | +      'database': source.database, | 
|  | 31 | +      'type': 'source' | 
|  | 32 | +    }) -%} | 
| 35 | 33 |   {%- endfor -%} | 
| 36 | 34 | 
 | 
| 37 | 35 |   {%- if table_info | length == 0 -%} | 
|  | 
| 138 | 136 | 
 | 
| 139 | 137 |   -- Get documented columns | 
| 140 | 138 |   {%- set documented_columns = [] -%} | 
| 141 |  | -  {%- for column_name, column_info in node.columns.items() -%} | 
| 142 |  | -    {%- do documented_columns.append(column_name.upper()) -%} | 
| 143 |  | -  {%- endfor -%} | 
|  | 139 | +  {%- if node.columns -%} | 
|  | 140 | +    {%- for column_name, column_info in node.columns.items() -%} | 
|  | 141 | +      {%- do documented_columns.append(column_name.upper()) -%} | 
|  | 142 | +    {%- endfor -%} | 
|  | 143 | +  {%- endif -%} | 
| 144 | 144 | 
 | 
| 145 | 145 |   -- Find missing and undocumented columns | 
| 146 | 146 |   {%- set documented_but_missing_columns = [] -%} | 
|  | 
| 221 | 221 | 
 | 
| 222 | 222 |   -- Validate models | 
| 223 | 223 |   {%- for node_id, node in graph.nodes.items() -%} | 
| 224 |  | -    {%- if node.resource_type == 'model' and node.columns -%} | 
|  | 224 | +    {%- if node.resource_type == 'model' -%} | 
| 225 | 225 |       {%- set result = _validate_single_table_schema(node, table_columns_info, 'model') -%} | 
| 226 | 226 |       {%- do validation_results.append(result) -%} | 
| 227 | 227 |     {%- endif -%} | 
| 228 | 228 |   {%- endfor -%} | 
| 229 | 229 | 
 | 
| 230 | 230 |   -- Validate sources | 
| 231 | 231 |   {%- for source_id, source in graph.sources.items() -%} | 
| 232 |  | -    {%- if source.columns -%} | 
| 233 |  | -      {%- set result = _validate_single_table_schema(source, table_columns_info, 'source') -%} | 
| 234 |  | -      {%- do validation_results.append(result) -%} | 
| 235 |  | -    {%- endif -%} | 
|  | 232 | +    {%- set result = _validate_single_table_schema(source, table_columns_info, 'source') -%} | 
|  | 233 | +    {%- do validation_results.append(result) -%} | 
| 236 | 234 |   {%- endfor -%} | 
| 237 | 235 | 
 | 
| 238 | 236 |   -- Process all validation results | 
|  | 
0 commit comments