zzzeek / test_sqlalchemy

0 stars 0 forks source link

use set ops in sqlalchemy/orm/mapper.py - prevents TypeError #957

Closed sqlalchemy-bot closed 16 years ago

sqlalchemy-bot commented 16 years ago

Issue created by Anonymous


This MAY be related to changes in #965, however, I had to make the following change. The program worked without change with 4.0.0. The same problem shows up in 0.4.2b, and possibly earlier versions.

The traceback:

File "/usr/lib/python2.3/site-packages/SQLAlchemy-0.4.2p3-py2.3.egg/sqlalchemy/orm/init.py", line 544, in mapper return Mapper(class_, local_table, *args, **params) File "/usr/lib/python2.3/site-packages/SQLAlchemy-0.4.2p3-py2.3.egg/sqlalchemy/orm/mapper.py", line 160, in init self._compile_pks() File "/usr/lib/python2.3/site-packages/SQLAlchemy-0.4.2p3-py2.3.egg/sqlalchemy/orm/mapper.py", line 416, in _compile_pks if t.primary_key and pk_cols.issuperset(t.primary_key): File "/usr/lib/python2.3/sets.py", line 318, in issuperset self._binary_sanity_check(other) File "/usr/lib/python2.3/sets.py", line 343, in _binary_sanity_check raise TypeError, "Binary operation only permitted between sets" TypeError: Binary operation only permitted between sets

The change will be added as a file.


Attachments: y.patch

sqlalchemy-bot commented 16 years ago

Michael Bayer (zzzeek) wrote:


the patch you posted wasn't used. issuperset is reimplemented at: source:/sqlalchemy/trunk/lib/sqlalchemy/util.py@4080#L34

sqlalchemy-bot commented 16 years ago

Michael Bayer (zzzeek) wrote:


hi -

all of the Set objects we use are custom to SQLAlchemy when using Python 2.3 at this point (jek has made those changes recently); have you tried the trunk ?

also shouldn't this ticket be a continuation of #956 ?

sqlalchemy-bot commented 16 years ago

Anonymous wrote:


Thanks for the explanation!

sqlalchemy-bot commented 16 years ago

jek (jek) wrote:


yep.

sqlalchemy-bot commented 16 years ago

Anonymous wrote:


Are you sure this ix fixed? I don't see this particular file or change in the changesets mentioned in #956.

sqlalchemy-bot commented 16 years ago

jek (jek) wrote:


This was fixed on the trunk in the post 0.4.p3 python 2.3 fixup, see #956.

sqlalchemy-bot commented 16 years ago

Anonymous wrote:


I meant #956, sorry.

sqlalchemy-bot commented 16 years ago

Changes by jek (jek): set state to "resolved"

sqlalchemy-bot commented 16 years ago

Changes by Anonymous: changed state from "resolved" to "open"

sqlalchemy-bot commented 16 years ago

Changes by jek (jek): set state to "duplicate"