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
$ python /tmp/satest.py
CASE test.foo WHEN :param_1 THEN :param_2 ELSE :param_3 END
Traceback (most recent call last):
File "/tmp/satest.py", line 16, in <module>
print(case({'a': 'aa'}, else_='c', value=Test.foo))
File "<string>", line 2, in case
File "/home/adrian/dev/indico/py3/env/lib/python3.9/site-packages/sqlalchemy/sql/elements.py", line 2755, in __init__
whenlist = [
File "/home/adrian/dev/indico/py3/env/lib/python3.9/site-packages/sqlalchemy/sql/elements.py", line 2764, in <listcomp>
for (c, r) in whens
ValueError: not enough values to unpack (expected 2, got 1)
Activity
zzzeek commentedon Mar 19, 2021
workaround, pass whens w/ the param name:
sqla-tester commentedon Mar 19, 2021
Mike Bayer has proposed a fix for this issue in the master branch:
Correct for coercion from list args to positional for case https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/2656