Can't pickle metadata with BOOLEAN columns in 0.6beta1
Issue #1694
resolved
The following code:
from sqlalchemy import *
meta = MetaData()
Table('foo',meta,Column('bar',BOOLEAN()))
from cPickle import dumps
dumps(meta)
throws
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/vol/devel/env/lib/python2.6/copy_reg.py", line 70, in _reduce_ex
raise TypeError, "can't pickle %s objects" % base.__name__
TypeError: can't pickle function objects
Replacing cPickle with pickle:
...
File "/usr/lib/python2.6/pickle.py", line 286, in save
f(self, obj) # Call unbound method with explicit self
File "/usr/lib/python2.6/pickle.py", line 748, in save_global
(obj, module, name))
pickle.PicklingError: Can't pickle <function should_create_constraint at 0x7f77e5541c80>: it's not found as sqlalchemy.types.should_create_constraint
Comments (7)
-
Account Deleted -
repo owner -
Account Deleted This is also a problem for Enum types.
-
repo owner also see
#1697for a similar issue withEnum
. -
Account Deleted also see
#1698for a similar issue with Enum -
repo owner - changed status to resolved
-
repo owner - removed milestone
Removing milestone: 0.6.0 (automated comment)
- Log in to comment
Tried out 0.6beta2dev-874bd42726d94f9c3afa96e86193aab054845429, same result.