You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For evaluated macro conditions (like those in @IF, body macros like @WHEN), the IN operator errors when the comparison array is length 1.
Works: 1 in (1,2)
Errors: 1 in (1)
from sqlglot import parse_one
from sqlmesh.core.macros import MacroEvaluator
query = "@IF(1 in (1,2), a, b)"
MacroEvaluator().transform(parse_one(query)).sql()
# 'a'
query = "@IF(1 in (1), a, b)"
MacroEvaluator().transform(parse_one(query)).sql()
# TypeError: argument of type 'int' is not iterable
# sqlmesh.utils.errors.MacroEvalError: Error trying to eval macro.
# Generated code: 1 in (1)
# Original sql: 1 IN (1)
The text was updated successfully, but these errors were encountered:
For evaluated macro conditions (like those in
@IF
, body macros like@WHEN
), the IN operator errors when the comparison array is length 1.Works:
1 in (1,2)
Errors:
1 in (1)
The text was updated successfully, but these errors were encountered: