File tree Expand file tree Collapse file tree 1 file changed +6
-11
lines changed
Expand file tree Collapse file tree 1 file changed +6
-11
lines changed Original file line number Diff line number Diff line change 1212from heapq import heappop , heappush
1313
1414from sqlglot import Dialect , expressions as exp
15- from sqlglot .helper import ensure_list
1615
1716if t .TYPE_CHECKING :
1817 from sqlglot .dialects .dialect import DialectType
@@ -372,16 +371,12 @@ def _parent_similarity_score(
372371 return 1 + _parent_similarity_score (source .parent , target .parent )
373372
374373
375- def _expression_only_args (expression : exp .Expression ) -> t .List [exp .Expression ]:
376- args : t .List [t .Union [exp .Expression , t .List ]] = []
377- if expression :
378- for a in expression .args .values ():
379- args .extend (ensure_list (a ))
380- return [
381- a
382- for a in args
383- if isinstance (a , exp .Expression ) and not isinstance (a , IGNORED_LEAF_EXPRESSION_TYPES )
384- ]
374+ def _expression_only_args (expression : exp .Expression ) -> t .Iterator [exp .Expression ]:
375+ yield from (
376+ arg
377+ for arg in expression .iter_expressions ()
378+ if not isinstance (arg , IGNORED_LEAF_EXPRESSION_TYPES )
379+ )
385380
386381
387382def _lcs (
You can’t perform that action at this time.
0 commit comments