On Tue, Jul 11, 2006 at 04:20:41PM -0400, Michael Bayer wrote: > hey - > > We can probably remove line 1338. that line is the product of a > previous version of the code where "group by" and "order by" were > more joined together, but I dont think anything will break if we take > it out. theres not a lot of "group by" stuff going on in general. > > can you try it out and let me know if it fixes the problem ? > > - mike >
Hi Mike, I've tested it; this fixed it nicely. After removing that line, the for loop only removes all order_by clauses from the *selects array. Thats nice for the optimizer, but I'm pretty sure that it can be removed too. class CompoundSelect(SelectBaseMixin, FromClause): def __init__(self, keyword, *selects, **kwargs): SelectBaseMixin.__init__(self) self.keyword = keyword self.selects = selects self.use_labels = kwargs.pop('use_labels', False) self.parens = kwargs.pop('parens', False) self.correlate = kwargs.pop('correlate', False) self.for_update = kwargs.pop('for_update', False) #for s in self.selects: # s.group_by(None) # s.order_by(None) self.group_by(*kwargs.get('group_by', [None])) self.order_by(*kwargs.get('order_by', [None])) self._col_map = {} What union does in SQL is pretty much to nothing; it doesn't even look at the names you give in the subselects, it just lists both selects. On http://bonsai.xs4all.nl/paste-example.py you can see some code illustrating a funny union at work. Regards, Kai -- begin 600 .signature ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Sqlalchemy-users mailing list Sqlalchemy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users