- changed status to resolved
generative .column() method don't work corretcly (columns will be added to cloned selects)
Issue #752
resolved
I found that using column() method on Select object, don't correctly creating new select statement - orginal statement and newly created statement have the same _raw_columns list. Then adding column to any select (new or orginal) gives this column to both statements. I think this is not how generative functions should work.
### --- PREPARATION
>>> from sqlalchemy import Table,Column,String,MetaData
>>> table = Table('foo',MetaData(),Column('bar',String))
>>> select = table.select()
### --- TESTs
>>> print select
SELECT foo.bar
FROM foo # ok
>>> select_copy = select.column('yyy')
>>> print select_copy
SELECT foo.bar, yyy
FROM foo # ok
>>> print select
SELECT foo.bar, yyy
FROM foo # VERY VERY BAD !
### --- CAUSE:
>>> select.columns is select_copy.columns
False # ok
>>> select._columns is select_copy._columns
False #ok
>>> select._raw_columns is select_copy._raw_columns
True # that is the problem i think
Comments (2)
-
repo owner -
repo owner - removed milestone
Removing milestone: 0.4.0 (automated comment)
- Log in to comment
thanks, fixed several of these in 72efa9db3a2591a36de69158435df9f4bb67ee15