Hi all,

Does anyone else have problems when trying to run the 
dictlike-polymorphic.py 
<https://docs.sqlalchemy.org/en/14/_modules/examples/vertical/dictlike-polymorphic.html>
 
example?  With sqlalchemy 1.4.20 and python2.7 I'm getting this traceback:
```
2021-07-14 14:04:25,847 INFO sqlalchemy.engine.Engine INSERT INTO 
animal_fact (animal_id, "key", type, int_value, char_value, boolean_value) 
VALUES (?, ?, ?, ?, ?, ?)
2021-07-14 14:04:25,847 INFO sqlalchemy.engine.Engine [cached since 
0.01913s ago] ((2, 'cuteness', 'integer', 5, None, None), (2, 'poisonous', 
'boolean', None, None, 0), (2, 'weasel-like', 'boolean', None, None, 1), 
(3, 'cuteness', 'integer', 5, None, None), (3, 'poisonous', 'boolean', 
None, None, 1), (3, 'weasel-like', 'boolean', None, None, 0))
2021-07-14 14:04:25,848 INFO sqlalchemy.engine.Engine COMMIT
Traceback (most recent call last):
  File "dictlike-polymorphic.py", line 222, in <module>
    and_(AnimalFact.key == "weasel-like", AnimalFact.value == True)
  File "lib/python2.7/site-packages/sqlalchemy/sql/operators.py", line 360, 
in __eq__
    return self.operate(eq, other)
  File "lib/python2.7/site-packages/sqlalchemy/orm/attributes.py", line 
316, in operate
    return op(self.comparator, *other, **kwargs)
  File "dictlike-polymorphic.py", line 89, in __eq__
    return self._case() == cast(other, String)
  File "dictlike-polymorphic.py", line 86, in _case
    return case(whens, self.cls.type, null())
  File "<string>", line 2, in case
  File "lib/python2.7/site-packages/sqlalchemy/sql/elements.py", line 2838, 
in __init__
    for (c, r) in whens
ValueError: too many values to unpack
```
Thanks,
Ian

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/1bd90c8a-261e-4ff3-8285-0510dc4523fcn%40googlegroups.com.

Reply via email to