File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 66
77from croniter import croniter
88from pydantic import Field , root_validator , validator
9- from sqlglot import exp , maybe_parse
9+ from sqlglot import exp
1010
1111from sqlmesh .core import dialect as d
1212from sqlmesh .core .model .kind import (
@@ -194,12 +194,14 @@ def _cron_validator(cls, v: t.Any) -> t.Optional[str]:
194194 return cron
195195
196196 @validator ("columns_to_types_" , pre = True )
197- def _columns_validator (cls , v : t .Any ) -> t .Optional [t .Dict [str , exp .DataType ]]:
197+ def _columns_validator (
198+ cls , v : t .Any , values : t .Dict [str , t .Any ]
199+ ) -> t .Optional [t .Dict [str , exp .DataType ]]:
198200 if isinstance (v , exp .Schema ):
199201 return {column .name : column .args ["kind" ] for column in v .expressions }
200202 if isinstance (v , dict ):
201203 return {
202- k : maybe_parse (data_type , into = exp . DataType ) # type: ignore
204+ k : exp . DataType . build (data_type , dialect = values [ "dialect" ])
203205 for k , data_type in v .items ()
204206 }
205207 return v
You can’t perform that action at this time.
0 commit comments