File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ authors = [{ name = "SQLMesh Contributors" }]
77license = { file = " LICENSE" }
88requires-python = " >= 3.9"
99dependencies = [
10- " astor" ,
1110 " click" ,
1211 " croniter" ,
1312 " duckdb>=0.10.0,!=0.10.3" ,
@@ -198,7 +197,6 @@ disable_error_code = "annotation-unchecked"
198197[[tool .mypy .overrides ]]
199198module = [
200199 " api.*" ,
201- " astor.*" ,
202200 " IPython.*" ,
203201 " hyperscript.*" ,
204202 " py.*" ,
Original file line number Diff line number Diff line change 44import typing as t
55from pathlib import Path
66
7- from astor import to_source
87from difflib import get_close_matches
98from sqlglot import exp
109from sqlglot .helper import ensure_list
@@ -387,7 +386,7 @@ def get_first_arg(keyword_arg_name: str) -> t.Any:
387386 )
388387
389388 try :
390- expression = to_source ( first_arg )
389+ expression = ast . unparse ( t . cast ( ast . expr , first_arg ) )
391390 return eval (expression , env , local_env )
392391 except Exception :
393392 if strict_resolution :
Original file line number Diff line number Diff line change 1717from numbers import Number
1818from pathlib import Path
1919
20- from astor import to_source
21-
2220from sqlmesh .core import constants as c
2321from sqlmesh .utils import format_exception , unique
2422from sqlmesh .utils .errors import SQLMeshError
@@ -274,7 +272,7 @@ def normalize_source(obj: t.Any) -> str:
274272 if isinstance (node , ast .FunctionDef ):
275273 node .returns = None
276274
277- return to_source (root_node ).strip ()
275+ return ast . unparse (root_node ).strip ()
278276
279277
280278def build_env (
You can’t perform that action at this time.
0 commit comments