File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 11from fastapi import APIRouter , Depends
22
33from sqlmesh .core .context import Context
4- from web .server .models import Model , Models
4+ from web .server .models import Column , Model , Models
55from web .server .settings import get_loaded_context
66
77router = APIRouter ()
@@ -19,6 +19,12 @@ def get_models(
1919 description = model .description ,
2020 owner = model .owner ,
2121 dialect = model .dialect ,
22+ columns = [
23+ Column (
24+ name = name , type = str (data_type ), description = model .column_descriptions .get (name )
25+ )
26+ for name , data_type in model .columns_to_types .items ()
27+ ],
2228 )
2329 for model in context .models .values ()
2430 }
Original file line number Diff line number Diff line change @@ -166,12 +166,19 @@ class EvaluateInput(BaseModel):
166166 limit : int = 1000
167167
168168
169+ class Column (BaseModel ):
170+ name : str
171+ type : str
172+ description : t .Optional [str ]
173+
174+
169175class Model (BaseModel ):
170176 name : str
171177 path : str
172178 dialect : str
173179 description : t .Optional [str ]
174180 owner : t .Optional [str ]
181+ columns : t .List [Column ]
175182
176183
177184class Models (BaseModel ):
You can’t perform that action at this time.
0 commit comments