Select using a value from a PickleType fails
Issue #1051
resolved
(original reporter: ged) Selects with a where criterion on a PickleType fails when the value itself is coming from a PickeType (see test case).
As a consequence of this, relationships using a PickleType column as a ForeignKey don't work.
After some investigation (print in process_bind_param), the pickled value is different in the cases which don't work. The source value seem to be the same though. There must be some subtle difference that I cannot see. Any idea?
'\x80\x02U\x04testq\x01\x85q\x02.' vs '\x80\x02U\x04test\x85q\x01.'
Comments (3)
-
repo owner -
Account Deleted - changed status to invalid
(original author: ged) I feared that answer... Didn't know that after all this time using Python... and usually avoiding pickles :)
-
Account Deleted (original author: ged) and sorry for the noise btw.
- Log in to comment
I dont think theres any SQLA issue here. pickle does not produce the identical string each time, particularly with Python datastructures like tuples and dicts, and is not appropriate as a constraint-bearing column type. A better choice would be JSON or similar.