sqlalchemy-tickets Mailing List for SQLAlchemy (Page 92)
Brought to you by:
zzzeek
You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
(174) |
Apr
(50) |
May
(71) |
Jun
(129) |
Jul
(113) |
Aug
(141) |
Sep
(82) |
Oct
(142) |
Nov
(97) |
Dec
(72) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(159) |
Feb
(213) |
Mar
(156) |
Apr
(151) |
May
(58) |
Jun
(166) |
Jul
(296) |
Aug
(198) |
Sep
(89) |
Oct
(133) |
Nov
(150) |
Dec
(122) |
| 2008 |
Jan
(144) |
Feb
(65) |
Mar
(71) |
Apr
(69) |
May
(143) |
Jun
(111) |
Jul
(113) |
Aug
(159) |
Sep
(81) |
Oct
(135) |
Nov
(107) |
Dec
(200) |
| 2009 |
Jan
(168) |
Feb
(109) |
Mar
(141) |
Apr
(128) |
May
(119) |
Jun
(132) |
Jul
(136) |
Aug
(154) |
Sep
(151) |
Oct
(181) |
Nov
(223) |
Dec
(169) |
| 2010 |
Jan
(103) |
Feb
(209) |
Mar
(201) |
Apr
(183) |
May
(134) |
Jun
(113) |
Jul
(110) |
Aug
(159) |
Sep
(138) |
Oct
(96) |
Nov
(116) |
Dec
(94) |
| 2011 |
Jan
(97) |
Feb
(188) |
Mar
(157) |
Apr
(158) |
May
(118) |
Jun
(102) |
Jul
(137) |
Aug
(113) |
Sep
(104) |
Oct
(108) |
Nov
(91) |
Dec
(162) |
| 2012 |
Jan
(189) |
Feb
(136) |
Mar
(153) |
Apr
(142) |
May
(90) |
Jun
(141) |
Jul
(67) |
Aug
(77) |
Sep
(113) |
Oct
(68) |
Nov
(101) |
Dec
(122) |
| 2013 |
Jan
(60) |
Feb
(77) |
Mar
(77) |
Apr
(129) |
May
(189) |
Jun
(155) |
Jul
(106) |
Aug
(123) |
Sep
(53) |
Oct
(142) |
Nov
(78) |
Dec
(102) |
| 2014 |
Jan
(143) |
Feb
(93) |
Mar
(35) |
Apr
(26) |
May
(27) |
Jun
(41) |
Jul
(45) |
Aug
(27) |
Sep
(37) |
Oct
(24) |
Nov
(22) |
Dec
(20) |
| 2015 |
Jan
(17) |
Feb
(15) |
Mar
(34) |
Apr
(55) |
May
(33) |
Jun
(31) |
Jul
(27) |
Aug
(17) |
Sep
(22) |
Oct
(26) |
Nov
(27) |
Dec
(22) |
| 2016 |
Jan
(20) |
Feb
(24) |
Mar
(23) |
Apr
(13) |
May
(17) |
Jun
(14) |
Jul
(31) |
Aug
(23) |
Sep
(24) |
Oct
(31) |
Nov
(23) |
Dec
(16) |
| 2017 |
Jan
(24) |
Feb
(20) |
Mar
(27) |
Apr
(24) |
May
(28) |
Jun
(18) |
Jul
(18) |
Aug
(23) |
Sep
(30) |
Oct
(17) |
Nov
(12) |
Dec
(12) |
| 2018 |
Jan
(27) |
Feb
(23) |
Mar
(13) |
Apr
(19) |
May
(21) |
Jun
(29) |
Jul
(11) |
Aug
(22) |
Sep
(14) |
Oct
(9) |
Nov
(24) |
Dec
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-08 17:41:49
|
#2751: assocaition proxy support for scalar-targeted attributes
------------------------------+----------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: defect | Status: reopened
Priority: high | Milestone: 0.9.0
Component: ext | Severity: minor - half an hour
Resolution: | Keywords:
Progress State: in progress |
------------------------------+----------------------------------
Changes (by zzzeek):
* status: closed => reopened
* resolution: fixed =>
* status_field: completed/closed => in progress
Comment:
this needs a full description in the migration guide, leaving this open as
a TODO.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2751#comment:5>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-08 17:33:07
|
#2751: assocaition proxy support for scalar-targeted attributes
-----------------------------------+----------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: defect | Status: closed
Priority: high | Milestone: 0.9.0
Component: ext | Severity: minor - half an hour
Resolution: fixed | Keywords:
Progress State: completed/closed |
-----------------------------------+----------------------------------
Description changed by zzzeek:
Old description:
> {{{
> #!python
> from sqlalchemy.engine import create_engine
> from sqlalchemy.ext.associationproxy import association_proxy
> from sqlalchemy.ext.declarative.api import declarative_base
> from sqlalchemy.orm import relationship
> from sqlalchemy.orm.session import sessionmaker
> from sqlalchemy.schema import Column, ForeignKey
> from sqlalchemy.types import Integer, String
>
> Base = declarative_base()
>
> class A(Base):
> __tablename__ = 'table_a'
> id = Column(Integer, primary_key=True)
> color = Column(String)
> def __init__(self, color):
> self.color = color
>
> class B(Base):
> __tablename__ = 'table_b'
> id = Column(Integer, primary_key=True)
> a_id = Column(Integer, ForeignKey('table_a.id'))
> a_re = relationship('A', backref='b_re')
> a_color = association_proxy('a_re', 'color')
>
> if __name__ == '__main__':
> engine = create_engine('sqlite:///:memory:', echo=True)
> Session = sessionmaker(engine)
> session = Session()
> Base.metadata.create_all(engine)
>
> b1 = B()
> b2 = B()
> b3 = B()
> b4 = B()
>
> b1.a_color = 'blue'
> b2.a_re = A(color=None)
>
> session.add_all([b1, b2, b3, b4])
>
> q = session.query(B).filter(B.a_color == None).all()
> p = session.query(B).filter(B.a_color != None).all()
> v = session.query(B).filter(B.a_color == 'blue').all()
>
> from sqlalchemy import __version__
> if __version__ >= "0.9.0":
>
> assert v == [b1]
> assert q == [b2, b3, b4]
> assert p == [b1]
>
> # will also add a special feature for this
> r = session.query(B).filter(B.a_color.has()).all()
> assert r == [b1, b2]
>
> # will also add a special feature for this
> w = session.query(B).filter(~B.a_color.has()).all()
> assert w == [b3, b4]
>
> # this is the equivalent of 0.8's B.a_color != None
> s = session.query(B).filter(
> or_(B.a_color != None,
> ~B.a_color.has())
> ).all()
> assert s == [b1, b3, b4]
> else:
> assert v == [b1]
> assert q == [b2]
> assert p == [b1, b3, b4]
> }}}
>
> this involves a behavioral change even to non-scalar association proxies,
> unless we special case it. If we have
> Parent.m2o_something.m2o_otherthing / Parent.other, the meaning of
> `Parent.other == None` normally includes just
> `Parent.m2o_something.has(m2o_otherthing=None)` - this adds in
> `~Parent.m2o_something.has()`.
>
> As the example illustrates, this totally changes return results so
> there's a very high chance applications are relying on the current
> behavior, and am leaning towards an 0.9 only here.
New description:
{{{
#!python
from sqlalchemy.engine import create_engine
from sqlalchemy.ext.associationproxy import association_proxy
from sqlalchemy.ext.declarative.api import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy.orm.session import sessionmaker
from sqlalchemy.schema import Column, ForeignKey
from sqlalchemy.types import Integer, String
Base = declarative_base()
class A(Base):
__tablename__ = 'table_a'
id = Column(Integer, primary_key=True)
color = Column(String)
def __init__(self, color):
self.color = color
class B(Base):
__tablename__ = 'table_b'
id = Column(Integer, primary_key=True)
a_id = Column(Integer, ForeignKey('table_a.id'))
a_re = relationship('A', backref='b_re')
a_color = association_proxy('a_re', 'color')
if __name__ == '__main__':
engine = create_engine('sqlite:///:memory:', echo=True)
Session = sessionmaker(engine)
session = Session()
Base.metadata.create_all(engine)
b1 = B()
b2 = B()
b3 = B()
b4 = B()
b1.a_color = 'blue'
b2.a_re = A(color=None)
session.add_all([b1, b2, b3, b4])
q = session.query(B).filter(B.a_color == None).all()
p = session.query(B).filter(B.a_color != None).all()
v = session.query(B).filter(B.a_color == 'blue').all()
z = session.query(B).filter(B.a_color != 'blue').all()
from sqlalchemy import __version__
if __version__ >= "0.9.0":
assert v == [b1]
assert q == [b2, b3]
assert p == [b1, b4]
assert z == [b4]
# will also add a special feature for this
r = session.query(B).filter(B.a_color.has()).all()
assert r == [b1, b2, b4]
# will also add a special feature for this
w = session.query(B).filter(~B.a_color.has()).all()
assert w == [b3]
# this is the equivalent of 0.8's B.a_color != None
s = session.query(B).filter(
or_(B.a_color != None,
~B.a_color.has())
).all()
assert s == [b1, b3, b4]
# the equivalent of 0.8's B.a_color != 'blue'
t = session.query(B).filter(
or_(
B.a_color != 'blue',
B.a_color == None
)
).all()
assert t == [b2, b3, b4]
else:
assert v == [b1]
assert q == [b2]
assert p == [b1, b3, b4]
assert z == [b2, b3, b4]
}}}
this involves a behavioral change even to non-scalar association proxies,
unless we special case it. If we have
Parent.m2o_something.m2o_otherthing / Parent.other, the meaning of
`Parent.other == None` normally includes just
`Parent.m2o_something.has(m2o_otherthing=None)` - this adds in
`~Parent.m2o_something.has()`.
As the example illustrates, this totally changes return results so there's
a very high chance applications are relying on the current behavior, and
am leaning towards an 0.9 only here.
--
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2751#comment:4>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-08 17:24:34
|
#2751: assocaition proxy support for scalar-targeted attributes
-----------------------------------+----------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: defect | Status: closed
Priority: high | Milestone: 0.9.0
Component: ext | Severity: minor - half an hour
Resolution: fixed | Keywords:
Progress State: completed/closed |
-----------------------------------+----------------------------------
Changes (by zzzeek):
* status: new => closed
* resolution: => fixed
* status_field: in progress => completed/closed
Comment:
this change is in r20d1e9c3fa8ccc992079.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2751#comment:3>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-08 17:21:03
|
#2751: assocaition proxy support for scalar-targeted attributes
------------------------------+----------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: defect | Status: new
Priority: high | Milestone: 0.9.0
Component: ext | Severity: minor - half an hour
Resolution: | Keywords:
Progress State: in progress |
------------------------------+----------------------------------
Description changed by zzzeek:
Old description:
> {{{
> #!python
> from sqlalchemy.engine import create_engine
> from sqlalchemy.ext.associationproxy import association_proxy
> from sqlalchemy.ext.declarative.api import declarative_base
> from sqlalchemy.orm import relationship
> from sqlalchemy.orm.session import sessionmaker
> from sqlalchemy.schema import Column, ForeignKey
> from sqlalchemy.types import Integer, String
>
> Base = declarative_base()
>
> class A(Base):
> __tablename__ = 'table_a'
> id = Column(Integer, primary_key=True)
> color = Column(String)
> def __init__(self, color):
> self.color = color
>
> class B(Base):
> __tablename__ = 'table_b'
> id = Column(Integer, primary_key=True)
> a_id = Column(Integer, ForeignKey('table_a.id'))
> a_re = relationship('A', backref='b_re')
> a_color = association_proxy('a_re', 'color')
>
> if __name__ == '__main__':
> engine = create_engine('sqlite:///:memory:', echo=True)
> Session = sessionmaker(engine)
> session = Session()
> Base.metadata.create_all(engine)
>
> b1 = B()
> b2 = B()
> b3 = B()
> b4 = B()
>
> b1.a_color = 'blue'
> b2.a_re = A(color=None)
>
> session.add_all([b1, b2, b3, b4])
>
> q = session.query(B).filter(B.a_color == None).all()
> p = session.query(B).filter(B.a_color != None).all()
>
> from sqlalchemy import __version__
> if __version__ >= "0.9.0":
>
> assert q == [b2, b3, b4]
> assert p == [b1]
>
> # will also add a special feature for this
> r = session.query(B).filter(B.a_color.has()).all()
> assert r == [b1, b2]
>
> # this is the equivalent of 0.8's B.a_color != None
> s = session.query(B).filter(
> or_(B.a_color != None,
> ~B.a_color.has())
> ).all()
> assert s == [b1, b3, b4]
> else:
> assert q == [b2]
> assert p == [b1, b3, b4]
> }}}
>
> this involves a behavioral change even to non-scalar association proxies,
> unless we special case it. If we have
> Parent.m2o_something.m2o_otherthing / Parent.other, the meaning of
> `Parent.other == None` normally includes just
> `Parent.m2o_something.has(m2o_otherthing=None)` - this adds in
> `~Parent.m2o_something.has()`.
>
> As the example illustrates, this totally changes return results so
> there's a very high chance applications are relying on the current
> behavior, and am leaning towards an 0.9 only here.
New description:
{{{
#!python
from sqlalchemy.engine import create_engine
from sqlalchemy.ext.associationproxy import association_proxy
from sqlalchemy.ext.declarative.api import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy.orm.session import sessionmaker
from sqlalchemy.schema import Column, ForeignKey
from sqlalchemy.types import Integer, String
Base = declarative_base()
class A(Base):
__tablename__ = 'table_a'
id = Column(Integer, primary_key=True)
color = Column(String)
def __init__(self, color):
self.color = color
class B(Base):
__tablename__ = 'table_b'
id = Column(Integer, primary_key=True)
a_id = Column(Integer, ForeignKey('table_a.id'))
a_re = relationship('A', backref='b_re')
a_color = association_proxy('a_re', 'color')
if __name__ == '__main__':
engine = create_engine('sqlite:///:memory:', echo=True)
Session = sessionmaker(engine)
session = Session()
Base.metadata.create_all(engine)
b1 = B()
b2 = B()
b3 = B()
b4 = B()
b1.a_color = 'blue'
b2.a_re = A(color=None)
session.add_all([b1, b2, b3, b4])
q = session.query(B).filter(B.a_color == None).all()
p = session.query(B).filter(B.a_color != None).all()
v = session.query(B).filter(B.a_color == 'blue').all()
from sqlalchemy import __version__
if __version__ >= "0.9.0":
assert v == [b1]
assert q == [b2, b3, b4]
assert p == [b1]
# will also add a special feature for this
r = session.query(B).filter(B.a_color.has()).all()
assert r == [b1, b2]
# will also add a special feature for this
w = session.query(B).filter(~B.a_color.has()).all()
assert w == [b3, b4]
# this is the equivalent of 0.8's B.a_color != None
s = session.query(B).filter(
or_(B.a_color != None,
~B.a_color.has())
).all()
assert s == [b1, b3, b4]
else:
assert v == [b1]
assert q == [b2]
assert p == [b1, b3, b4]
}}}
this involves a behavioral change even to non-scalar association proxies,
unless we special case it. If we have
Parent.m2o_something.m2o_otherthing / Parent.other, the meaning of
`Parent.other == None` normally includes just
`Parent.m2o_something.has(m2o_otherthing=None)` - this adds in
`~Parent.m2o_something.has()`.
As the example illustrates, this totally changes return results so there's
a very high chance applications are relying on the current behavior, and
am leaning towards an 0.9 only here.
--
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2751#comment:2>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-08 16:59:53
|
#2751: assocaition proxy support for scalar-targeted attributes
------------------------------+----------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: defect | Status: new
Priority: high | Milestone: 0.9.0
Component: ext | Severity: minor - half an hour
Resolution: | Keywords:
Progress State: in progress |
------------------------------+----------------------------------
Changes (by zzzeek):
* priority: medium => high
* milestone: 0.8.xx => 0.9.0
Old description:
> {{{
> #!python
> from sqlalchemy.engine import create_engine
> from sqlalchemy.ext.associationproxy import association_proxy
> from sqlalchemy.ext.declarative.api import declarative_base
> from sqlalchemy.orm import relationship
> from sqlalchemy.orm.session import sessionmaker
> from sqlalchemy.schema import Column, ForeignKey
> from sqlalchemy.types import Integer, String
>
> Base = declarative_base()
>
> class A(Base):
> __tablename__ = 'table_a'
> id = Column(Integer, primary_key=True)
> color = Column(String)
> def __init__(self, color):
> self.color = color
>
> class B(Base):
> __tablename__ = 'table_b'
> id = Column(Integer, primary_key=True)
> a_id = Column(Integer, ForeignKey('table_a.id'))
> a_re = relationship('A', backref='b_re')
> a_color = association_proxy('a_re', 'color')
>
> if __name__ == '__main__':
> engine = create_engine('sqlite:///:memory:', echo=True)
> Session = sessionmaker(engine)
> session = Session()
> Base.metadata.create_all(engine)
>
> b1 = B()
> b2 = B()
> b3 = B()
> b4 = B()
>
> b1.a_color = 'blue'
> b2.a_re = A(color=None)
>
> session.add_all([b1, b2, b3, b4])
>
> q = session.query(B).filter(B.a_color == None).all()
> p = session.query(B).filter(B.a_color != None).all()
>
> # will also add a special feature for this
> r = session.query(B).filter(B.a_color.has()).all()
>
> assert q == [b2, b3, b4]
> assert p == [b1]
> assert r == [b1, b2]
> }}}
New description:
{{{
#!python
from sqlalchemy.engine import create_engine
from sqlalchemy.ext.associationproxy import association_proxy
from sqlalchemy.ext.declarative.api import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy.orm.session import sessionmaker
from sqlalchemy.schema import Column, ForeignKey
from sqlalchemy.types import Integer, String
Base = declarative_base()
class A(Base):
__tablename__ = 'table_a'
id = Column(Integer, primary_key=True)
color = Column(String)
def __init__(self, color):
self.color = color
class B(Base):
__tablename__ = 'table_b'
id = Column(Integer, primary_key=True)
a_id = Column(Integer, ForeignKey('table_a.id'))
a_re = relationship('A', backref='b_re')
a_color = association_proxy('a_re', 'color')
if __name__ == '__main__':
engine = create_engine('sqlite:///:memory:', echo=True)
Session = sessionmaker(engine)
session = Session()
Base.metadata.create_all(engine)
b1 = B()
b2 = B()
b3 = B()
b4 = B()
b1.a_color = 'blue'
b2.a_re = A(color=None)
session.add_all([b1, b2, b3, b4])
q = session.query(B).filter(B.a_color == None).all()
p = session.query(B).filter(B.a_color != None).all()
from sqlalchemy import __version__
if __version__ >= "0.9.0":
assert q == [b2, b3, b4]
assert p == [b1]
# will also add a special feature for this
r = session.query(B).filter(B.a_color.has()).all()
assert r == [b1, b2]
# this is the equivalent of 0.8's B.a_color != None
s = session.query(B).filter(
or_(B.a_color != None,
~B.a_color.has())
).all()
assert s == [b1, b3, b4]
else:
assert q == [b2]
assert p == [b1, b3, b4]
}}}
this involves a behavioral change even to non-scalar association proxies,
unless we special case it. If we have
Parent.m2o_something.m2o_otherthing / Parent.other, the meaning of
`Parent.other == None` normally includes just
`Parent.m2o_something.has(m2o_otherthing=None)` - this adds in
`~Parent.m2o_something.has()`.
As the example illustrates, this totally changes return results so there's
a very high chance applications are relying on the current behavior, and
am leaning towards an 0.9 only here.
--
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2751#comment:1>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-08 16:34:54
|
#2751: assocaition proxy support for scalar-targeted attributes
--------------------+---------------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: defect | Status: new
Priority: medium | Milestone: 0.8.xx
Component: ext | Severity: minor - half an hour
Keywords: | Progress State: in progress
--------------------+---------------------------------------
{{{
#!python
from sqlalchemy.engine import create_engine
from sqlalchemy.ext.associationproxy import association_proxy
from sqlalchemy.ext.declarative.api import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy.orm.session import sessionmaker
from sqlalchemy.schema import Column, ForeignKey
from sqlalchemy.types import Integer, String
Base = declarative_base()
class A(Base):
__tablename__ = 'table_a'
id = Column(Integer, primary_key=True)
color = Column(String)
def __init__(self, color):
self.color = color
class B(Base):
__tablename__ = 'table_b'
id = Column(Integer, primary_key=True)
a_id = Column(Integer, ForeignKey('table_a.id'))
a_re = relationship('A', backref='b_re')
a_color = association_proxy('a_re', 'color')
if __name__ == '__main__':
engine = create_engine('sqlite:///:memory:', echo=True)
Session = sessionmaker(engine)
session = Session()
Base.metadata.create_all(engine)
b1 = B()
b2 = B()
b3 = B()
b4 = B()
b1.a_color = 'blue'
b2.a_re = A(color=None)
session.add_all([b1, b2, b3, b4])
q = session.query(B).filter(B.a_color == None).all()
p = session.query(B).filter(B.a_color != None).all()
# will also add a special feature for this
r = session.query(B).filter(B.a_color.has()).all()
assert q == [b2, b3, b4]
assert p == [b1]
assert r == [b1, b2]
}}}
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2751>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-08 03:08:28
|
#2727: ProgrammingError when autoload from PostgreSQL (Amazon Redshift)
---------------------------+----------------------------------
Reporter: ashkop | Owner: zzzeek
Type: defect | Status: new
Priority: medium | Milestone: 0.x.xx
Component: postgres | Severity: minor - half an hour
Resolution: | Keywords:
Progress State: on hold |
---------------------------+----------------------------------
Comment (by mattg):
As you mentioned on twitter, i took the easy way with the dialect i have
here: https://github.com/binarydud/redshift_sqlalchemy.
The reason I went down this route to begin with is that according to this
documentation:
http://docs.aws.amazon.com/redshift/latest/dg/t_Defining_constraints.html,
constraints on informational only, they are not enforced.
My longer term goal is to try support the constraints, but because of the
postgres 8.0 api this has proved a little difficult so far.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2727#comment:12>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-08 03:05:33
|
#2369: many-to-many + single table joined eager fails since we don't parenthesize
joins
-----------------------------------+--------------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: defect | Status: closed
Priority: high | Milestone: 0.9.0
Component: orm | Severity: refactor - over two days
Resolution: fixed | Keywords:
Progress State: completed/closed |
-----------------------------------+--------------------------------------
Changes (by zzzeek):
* status: new => closed
* resolution: => fixed
* severity: very major - up to 2 days => refactor - over two days
* status_field: in queue => completed/closed
Comment:
rd5363fca5400f6c4969c2756f
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2369#comment:9>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-08 02:17:31
|
#2369: many-to-many + single table joined eager fails since we don't parenthesize
joins
---------------------------+---------------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: defect | Status: new
Priority: high | Milestone: 0.9.0
Component: orm | Severity: very major - up to 2 days
Resolution: | Keywords:
Progress State: in queue |
---------------------------+---------------------------------------
Comment (by zzzeek):
ha! that's not the problem! it's just the ON clause of that last LEFT
OUTER JOIN joining to the wrong "items" entity and I have the fix for that
here.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2369#comment:8>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-08 01:13:43
|
#2748: fix default argument of None for
DefaultDialect.reflecttable->exclude_columns, should be ()
------------------------------+-----------------------------------
Reporter: rstuart4133 | Owner: zzzeek
Type: defect | Status: new
Priority: medium | Milestone: 0.8.xx
Component: schema | Severity: trivial - <10 minutes
Resolution: | Keywords:
Progress State: in queue |
------------------------------+-----------------------------------
Changes (by zzzeek):
* status_field: needs questions answered => in queue
* severity: minor - half an hour => trivial - <10 minutes
Comment:
OK engine.reflecttable() was removed in 0.8 and as you can see in 0.7 it's
marked deprecated. So while the signature of DefaultDialect.reflecttable
should be fixed, I'm not seeing any current public API issues. As for
0.7 I can check in a fix but I don't know that more 0.7 releases are
planned at this time.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2748#comment:3>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-07 23:54:19
|
#2748: reflecttable not checking for None exclude_columns
-------------------------------------------+-------------------------------
Reporter: rstuart4133 | Owner: zzzeek
Type: defect | Status: new
Priority: medium | Milestone: 0.8.xx
Component: schema | Severity: minor - half an
Resolution: | hour
Progress State: needs questions answered | Keywords:
-------------------------------------------+-------------------------------
Comment (by rstuart4133):
> Are you using it directly
No. This is all I have to do to reproduce the bug:
{{{
$ python
Python 2.7.3 (default, Jan 2 2013, 13:56:14)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Debug helper loaded. Type "print D.__doc__" for help.
>>> import sqlalchemy
>>> conn =
sqlalchemy.create_engine("firebird://ro:ro@10.7.0.3/lubenet/mobile.gdb").connect()>>>
metatable = sqlalchemy.MetaData(conn)
>>> est = sqlalchemy.Table("estline", metatable)
>>> conn.engine.reflecttable(est)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<string>", line 1, in <lambda>
File "/usr/lib/python2.7/dist-packages/sqlalchemy/util/deprecations.py",
line 100, in warned
return fn(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line
2533, in reflecttable
self.dialect.reflecttable(conn, table, include_columns)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/default.py",
line 260, in reflecttable
return insp.reflecttable(table, include_columns, exclude_columns)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/reflection.py",
line 419, in reflecttable
if pk in table.c and pk not in exclude_columns
TypeError: argument of type 'NoneType' is not iterable
>>> sqlalchemy.__version__
'0.7.8'
>>>
}}}
> or is there some codepath that it becomes None?
Yes, there is. It is the one you see in the backtrace. I'll spell it out
for you, using the line numbers from rel_0_7 in github:
* I call sqlalchemy/engine/base.py:2516 `Engine.reflecttable()`
* On line 2532 it calls sqlalchemy/engine/default.py:258
`DefaultDialect.reflecttable(..., exclude_columns=None)`
* On line 260 it calls sqlalchemy/engine/reflection.py:258
`Inspector.reflecttable()`, passing `None` for `exclude_columns`.
* On line 419, it does not modify `pk not in exclude_columns`, and
execute `pk not in exclude_columns`.
* Thus `TypeError` is raised.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2748#comment:2>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-07 22:10:53
|
#2587: flatten joined-inheritance join targets on individual tables
------------------------------+---------------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: enhancement | Status: new
Priority: medium | Milestone: 0.9.0
Component: orm | Severity: very major - up to 2 days
Resolution: | Keywords:
Progress State: in queue |
------------------------------+---------------------------------------
Comment (by zzzeek):
most of how this has proceeded can be seen in
diff:@32716eae773e6f6b7f37baf705342c1ed89df461:69e9574fefd5fbb4673c99ad476a00b03fe22318
, still some cleanup to go + docs.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2587#comment:7>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-07 16:44:05
|
#2750: Inconsistent behavior for polymorphic queries
------------------------------+----------------------------------
Reporter: schlamar | Owner: zzzeek
Type: defect | Status: new
Priority: high | Milestone: 0.8.xx
Component: orm | Severity: minor - half an hour
Resolution: | Keywords:
Progress State: needs tests |
------------------------------+----------------------------------
Changes (by zzzeek):
* priority: medium => high
* status_field: awaiting triage => needs tests
* severity: no triage selected yet => minor - half an hour
* milestone: => 0.8.xx
Comment:
It shouldn't let you persist on a joined inh with an incompatible type,
but note that we do support sending this type for the single table use
case. Ultimately the type has to be reconciled against the tables
corresponding to it.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2750#comment:1>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-07 15:21:57
|
#2750: Inconsistent behavior for polymorphic queries
----------------------+-----------------------------------------
Reporter: schlamar | Owner: zzzeek
Type: defect | Status: new
Priority: medium | Milestone:
Component: orm | Severity: no triage selected yet
Keywords: | Progress State: awaiting triage
----------------------+-----------------------------------------
This is my test case:
{{{
#!python
from sqlalchemy import create_engine, Column, ForeignKey, Integer, String
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class Model(Base):
__tablename__ = 'model'
id = Column(Integer, primary_key=True)
label = Column(String)
mtype = Column(Integer, nullable=False)
__mapper_args__ = {'polymorphic_on': mtype}
class SubModel(Model):
__tablename__ = 'submodel'
id = Column(Integer, ForeignKey('model.id'), primary_key=True)
__mapper_args__ = {'polymorphic_identity': 1}
def main():
engine = create_engine('sqlite:///:memory:')
Base.metadata.create_all(engine)
Session = sessionmaker(bind=engine)
session = Session()
m = Model(mtype=1)
m.label = 'x'
session.add(m)
session.commit()
m_id = m.id
session = Session()
m = session.query(Model).get(m_id)
m.label = 'y'
session.commit()
print m.id
}}}
This yields the following error:
{{{
Traceback (most recent call last):
File "sqla_test.py", line 44, in <module>
main()
File "sqla_test.py", line 40, in main
print m.id
File "D:\Projekte\HACS\packages\sqlalchemy\orm\attributes.py", line 316,
in __get__
return self.impl.get(instance_state(instance), dict_)
File "D:\Projekte\HACS\packages\sqlalchemy\orm\attributes.py", line 611,
in get
value = callable_(passive)
File "D:\Projekte\HACS\packages\sqlalchemy\orm\state.py", line 375, in
__call__
self.manager.deferred_scalar_loader(self, toload)
File "D:\Projekte\HACS\packages\sqlalchemy\orm\loading.py", line 606, in
load_scalar_attributes
raise orm_exc.ObjectDeletedError(state)
sqlalchemy.orm.exc.ObjectDeletedError: Instance '<SubModel at 0x2f0eeb0>'
has been deleted, or its row is otherwise not
present.
}}}
I have already investigated and can explain the behavior: the query
returns actually a !SubModel instance because of `mtype == 1`. After the
commit the object is expired so a new query is issued which joins model
against submodel. But an entry in the submodel table was never created.
This behavior is really inconsistent. SQLAlchemy should throw an error on
the query or on the insert. Alternatively, it might fix the insert
automatically by creating an corresponding entry to submodel.
Besides, if you issue `session.query(SubModel).get(m_id)` you get the same
error message, which is really misleading.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2750>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-07 14:39:55
|
#2749: quoting for function names
--------------------+---------------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: defect | Status: new
Priority: medium | Milestone: 0.8.xx
Component: sql | Severity: minor - half an hour
Keywords: | Progress State: in queue
--------------------+---------------------------------------
see attached patch
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2749>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-07 14:17:12
|
#2748: reflecttable not checking for None exclude_columns
-------------------------------------------+-------------------------------
Reporter: rstuart4133 | Owner: zzzeek
Type: defect | Status: new
Priority: medium | Milestone: 0.8.xx
Component: schema | Severity: minor - half an
Resolution: | hour
Progress State: needs questions answered | Keywords:
-------------------------------------------+-------------------------------
Changes (by zzzeek):
* status_field: awaiting triage => needs questions answered
* component: cextensions => schema
* severity: no triage selected yet => minor - half an hour
* milestone: => 0.8.xx
Comment:
`exclude_columns` has not been considered public API, even though it seems
to have found its way to reflection.reflecttable, it's not present in the
usual `Table()` API. Are you using it directly or is there some codepath
that it becomes `None`? (I'm not seeing one). It's assumed to always be
non-None right now (the boolean checks are for emptiness).
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2748#comment:1>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-07 11:47:06
|
#2748: reflecttable not checking for None exclude_columns
-------------------------+-----------------------------------------
Reporter: rstuart4133 | Owner: zzzeek
Type: defect | Status: new
Priority: medium | Milestone:
Component: cextensions | Severity: no triage selected yet
Keywords: | Progress State: awaiting triage
-------------------------+-----------------------------------------
This code in reflection.py:reflecttable():
{{{
if pk_cons:
pk_cols = [table.c[pk]
for pk in pk_cons['constrained_columns']
if pk in table.c and pk not in exclude_columns
] + [pk for pk in table.primary_key if pk.key in
exclude_columns]
}}}
Should check if exclude_columns is None. All the previous references to
exclude_columns do, and it turns out it is necessary:
{{{
>>> conn.engine.reflecttable(est)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<string>", line 1, in <lambda>
File "/usr/lib/python2.7/dist-packages/sqlalchemy/util/deprecations.py",
line 100, in warned
return fn(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line
2533, in reflecttable
self.dialect.reflecttable(conn, table, include_columns)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/default.py",
line 260, in reflecttable
return insp.reflecttable(table, include_columns, exclude_columns)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/reflection.py",
line 419, in reflecttable
if pk in table.c and pk not in exclude_columns
TypeError: argument of type 'NoneType' is not iterable
>>>
}}}
This was in version 0.7.8, but the same problem exists in github master.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2748>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-06 23:39:36
|
#2746: Add a flag to explicitly enable correlation even when the subquery has
`asfrom=True`
------------------------------+----------------------------------
Reporter: sayap | Owner: zzzeek
Type: enhancement | Status: new
Priority: medium | Milestone: 0.9.0
Component: sql | Severity: minor - half an hour
Resolution: | Keywords:
Progress State: in queue |
------------------------------+----------------------------------
Comment (by sayap):
Thanks, patch works great. "within_from_ok" sounds about right to me
(disclaimer: I suck at naming things).
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2746#comment:3>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-06 18:13:26
|
#2746: Add a flag to explicitly enable correlation even when the subquery has
`asfrom=True`
------------------------------+----------------------------------
Reporter: sayap | Owner: zzzeek
Type: enhancement | Status: new
Priority: medium | Milestone: 0.9.0
Component: sql | Severity: minor - half an hour
Resolution: | Keywords:
Progress State: in queue |
------------------------------+----------------------------------
Comment (by zzzeek):
dont know what the flag should be named though. maybe "within_from_ok".
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2746#comment:2>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-06 18:11:21
|
#2746: Add a flag to explicitly enable correlation even when the subquery has
`asfrom=True`
------------------------------+----------------------------------
Reporter: sayap | Owner: zzzeek
Type: enhancement | Status: new
Priority: medium | Milestone: 0.9.0
Component: sql | Severity: minor - half an hour
Resolution: | Keywords:
Progress State: in queue |
------------------------------+----------------------------------
Changes (by zzzeek):
* priority: low => medium
* status_field: not decided upon => in queue
* type: task => enhancement
* severity: no triage selected yet => minor - half an hour
* milestone: => 0.9.0
Comment:
well the funny thing here is that we've had a long-standing comment in the
compiler, regarding the fact that the list of "Existing froms" we pass in
is only from the immediate enclosing SELECT, not the SELECT that's
enclosing that one. I think at least we know we can take that out, since
that only applies to auto-correlation and I think we can agree auto-
correlation out of the FROM clause is not necessary. This is the case
where you say, "omit these elements from the FROM clause,
unconditionally".
I'd rather make this specific to each FROM for the "correlate" case.
See the attached patch.
{{{
#!python
t1 = table('t1', column('a'))
t2 = table('t2', column('a'), column('b'))
s = select(
[t2.c.b],
t1.c.a == t2.c.a,
).correlate_except(t2, froms=True).alias('s')
s2 = select([func.foo(s.c.b)]).as_scalar()
s3 = select([t1], order_by=s2)
print s3
}}}
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2746#comment:1>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-06 16:56:57
|
#2747: Version 0.8.1 can't reflect a table in mssql server 2000
-----------------------------------+----------------------------------
Reporter: nosklo | Owner:
Type: defect | Status: closed
Priority: high | Milestone: 0.8.xx
Component: mssql | Severity: minor - half an hour
Resolution: fixed | Keywords: regression
Progress State: completed/closed |
-----------------------------------+----------------------------------
Changes (by zzzeek):
* status: new => closed
* milestone: => 0.8.xx
* resolution: => fixed
* severity: no triage selected yet => minor - half an hour
* status_field: awaiting triage => completed/closed
Comment:
ah OK was wondering if that was going to impact some versions. a
workaround to disable the cast on versions below 2005 is in
r45f8ff88c920937458 (0.8) r555f30d64c23558a13bb (master)
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2747#comment:1>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-06 15:02:55
|
#2747: Version 0.8.1 can't reflect a table in mssql server 2000
------------------------+-----------------------------------------
Reporter: nosklo | Owner:
Type: defect | Status: new
Priority: high | Milestone:
Component: mssql | Severity: no triage selected yet
Keywords: regression | Progress State: awaiting triage
------------------------+-----------------------------------------
This is accessing a SQL Server 2000 from Linux using FreeTDS + Unixodbc +
pyodbc.
Using version 0.8.0 it works works fine. But when trying the new 0.8.1
version got a sqlalchemy.exc.ProgrammingError: (ProgrammingError)
('42000', '[42000] [FreeTDS][SQL Server]Statement(s) could not be
prepared. (8180) (SQLExecDirectW)')
By examining both generated queries, it seems the new version generates a
CAST(? AS NVARCHAR(max)) and that doesn't work on SQL SERVER 2000. Please
provide a way to disable this cast when sql version is 8 or lower.
Full code and traceback output is below:
Code:
{{{#!python
import sqlalchemy
import urllib
table_name = 'lancamentos_passivo'
con_string =
'servername=mg7684sr300;uid=rsa;pwd=some_pwd;database=Passivo;driver={FreeTDS};app=testapp'
con_string = urllib.quote_plus(con_string)
engine = sqlalchemy.create_engine('mssql:///?odbc_connect=' + con_string,
echo=True)
meta = sqlalchemy.MetaData(bind=engine)
tb = sqlalchemy.Table(table_name, meta, autoload=True)
}}}
Version rel_0_8_1 output:
{{{#!python
2013-06-06 11:51:29,925 INFO sqlalchemy.engine.base.Engine SELECT
user_name()
2013-06-06 11:51:29,925 INFO sqlalchemy.engine.base.Engine ()
2013-06-06 11:51:29,927 INFO sqlalchemy.engine.base.Engine
SELECT default_schema_name FROM
sys.database_principals
WHERE name = ?
AND type = 'S'
2013-06-06 11:51:29,927 INFO sqlalchemy.engine.base.Engine (u'dbo',)
2013-06-06 11:51:29,936 INFO sqlalchemy.engine.base.Engine SELECT
[COLUMNS_1].[TABLE_SCHEMA], [COLUMNS_1].[TABLE_NAME],
[COLUMNS_1].[COLUMN_NAME], [COLUMNS_1].[IS_NULLABLE],
[COLUMNS_1].[DATA_TYPE], [COLUMNS_1].[ORDINAL_POSITION],
[COLUMNS_1].[CHARACTER_MAXIMUM_LENGTH], [COLUMNS_1].[NUMERIC_PRECISION],
[COLUMNS_1].[NUMERIC_SCALE], [COLUMNS_1].[COLUMN_DEFAULT],
[COLUMNS_1].[COLLATION_NAME]
FROM [INFORMATION_SCHEMA].[COLUMNS] AS [COLUMNS_1]
WHERE [COLUMNS_1].[TABLE_NAME] = CAST(? AS NVARCHAR(max)) AND
[COLUMNS_1].[TABLE_SCHEMA] = CAST(? AS NVARCHAR(max)) ORDER BY
[COLUMNS_1].[ORDINAL_POSITION]
2013-06-06 11:51:29,936 INFO sqlalchemy.engine.base.Engine
(u'lancamentos_passivo', u'dbo')
2013-06-06 11:51:29,953 INFO sqlalchemy.engine.base.Engine ROLLBACK
Traceback (most recent call last):
File "/tmp/teste.py", line 10, in <module>
tb = sqlalchemy.Table(table_name, meta, autoload=True)
File "/home/c036337/.local/lib/python2.7/site-
packages/sqlalchemy/schema.py", line 332, in __new__
table._init(name, metadata, *args, **kw)
File "/home/c036337/.local/lib/python2.7/site-
packages/sqlalchemy/schema.py", line 396, in _init
self._autoload(metadata, autoload_with, include_columns)
File "/home/c036337/.local/lib/python2.7/site-
packages/sqlalchemy/schema.py", line 424, in _autoload
self, include_columns, exclude_columns
File "/home/c036337/.local/lib/python2.7/site-
packages/sqlalchemy/engine/base.py", line 1595, in run_callable
return conn.run_callable(callable_, *args, **kwargs)
File "/home/c036337/.local/lib/python2.7/site-
packages/sqlalchemy/engine/base.py", line 1118, in run_callable
return callable_(self, *args, **kwargs)
File "/home/c036337/.local/lib/python2.7/site-
packages/sqlalchemy/engine/default.py", line 262, in reflecttable
return insp.reflecttable(table, include_columns, exclude_columns)
File "/home/c036337/.local/lib/python2.7/site-
packages/sqlalchemy/engine/reflection.py", line 397, in reflecttable
for col_d in self.get_columns(table_name, schema, **tblkw):
File "/home/c036337/.local/lib/python2.7/site-
packages/sqlalchemy/engine/reflection.py", line 254, in get_columns
**kw)
File "<string>", line 1, in <lambda>
File "/home/c036337/.local/lib/python2.7/site-
packages/sqlalchemy/engine/reflection.py", line 49, in cache
ret = fn(self, con, *args, **kw)
File "/home/c036337/.local/lib/python2.7/site-
packages/sqlalchemy/dialects/mssql/base.py", line 1050, in wrap
tablename, dbname, owner, schema, **kw)
File "/home/c036337/.local/lib/python2.7/site-
packages/sqlalchemy/dialects/mssql/base.py", line 1059, in _switch_db
return fn(*arg, **kw)
File "/home/c036337/.local/lib/python2.7/site-
packages/sqlalchemy/dialects/mssql/base.py", line 1310, in get_columns
c = connection.execute(s)
File "/home/c036337/.local/lib/python2.7/site-
packages/sqlalchemy/engine/base.py", line 662, in execute
params)
File "/home/c036337/.local/lib/python2.7/site-
packages/sqlalchemy/engine/base.py", line 761, in _execute_clauseelement
compiled_sql, distilled_params
File "/home/c036337/.local/lib/python2.7/site-
packages/sqlalchemy/engine/base.py", line 874, in _execute_context
context)
File "/home/c036337/.local/lib/python2.7/site-
packages/sqlalchemy/engine/base.py", line 1024, in _handle_dbapi_exception
exc_info
File "/home/c036337/.local/lib/python2.7/site-
packages/sqlalchemy/util/compat.py", line 163, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb)
File "/home/c036337/.local/lib/python2.7/site-
packages/sqlalchemy/engine/base.py", line 867, in _execute_context
context)
File "/home/c036337/.local/lib/python2.7/site-
packages/sqlalchemy/engine/default.py", line 324, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.ProgrammingError: (ProgrammingError) ('42000', '[42000]
[FreeTDS][SQL Server]Statement(s) could not be prepared. (8180)
(SQLExecDirectW)') 'SELECT [COLUMNS_1].[TABLE_SCHEMA],
[COLUMNS_1].[TABLE_NAME], [COLUMNS_1].[COLUMN_NAME],
[COLUMNS_1].[IS_NULLABLE], [COLUMNS_1].[DATA_TYPE],
[COLUMNS_1].[ORDINAL_POSITION], [COLUMNS_1].[CHARACTER_MAXIMUM_LENGTH],
[COLUMNS_1].[NUMERIC_PRECISION], [COLUMNS_1].[NUMERIC_SCALE],
[COLUMNS_1].[COLUMN_DEFAULT], [COLUMNS_1].[COLLATION_NAME] \nFROM
[INFORMATION_SCHEMA].[COLUMNS] AS [COLUMNS_1] \nWHERE
[COLUMNS_1].[TABLE_NAME] = CAST(? AS NVARCHAR(max)) AND
[COLUMNS_1].[TABLE_SCHEMA] = CAST(? AS NVARCHAR(max)) ORDER BY
[COLUMNS_1].[ORDINAL_POSITION]' (u'lancamentos_passivo', u'dbo')
}}}
Version rel_0_8_0 output:
{{{#!python
2013-06-06 11:50:11,313 INFO sqlalchemy.engine.base.Engine SELECT
user_name()
2013-06-06 11:50:11,313 INFO sqlalchemy.engine.base.Engine ()
2013-06-06 11:50:11,316 INFO sqlalchemy.engine.base.Engine
SELECT default_schema_name FROM
sys.database_principals
WHERE name = ?
AND type = 'S'
2013-06-06 11:50:11,316 INFO sqlalchemy.engine.base.Engine (u'dbo',)
2013-06-06 11:50:11,331 INFO sqlalchemy.engine.base.Engine SELECT
[COLUMNS_1].[TABLE_SCHEMA], [COLUMNS_1].[TABLE_NAME],
[COLUMNS_1].[COLUMN_NAME], [COLUMNS_1].[IS_NULLABLE],
[COLUMNS_1].[DATA_TYPE], [COLUMNS_1].[ORDINAL_POSITION],
[COLUMNS_1].[CHARACTER_MAXIMUM_LENGTH], [COLUMNS_1].[NUMERIC_PRECISION],
[COLUMNS_1].[NUMERIC_SCALE], [COLUMNS_1].[COLUMN_DEFAULT],
[COLUMNS_1].[COLLATION_NAME]
FROM [INFORMATION_SCHEMA].[COLUMNS] AS [COLUMNS_1]
WHERE [COLUMNS_1].[TABLE_NAME] = ? AND [COLUMNS_1].[TABLE_SCHEMA] = ?
ORDER BY [COLUMNS_1].[ORDINAL_POSITION]
2013-06-06 11:50:11,331 INFO sqlalchemy.engine.base.Engine
(u'lancamentos_passivo', u'dbo')
2013-06-06 11:50:11,405 INFO sqlalchemy.engine.base.Engine sp_columns
@table_name = 'lancamentos_passivo', @table_owner = 'dbo'
2013-06-06 11:50:11,406 INFO sqlalchemy.engine.base.Engine ()
2013-06-06 11:50:11,424 INFO sqlalchemy.engine.base.Engine SELECT
[C].[COLUMN_NAME], [TABLE_CONSTRAINTS_1].[CONSTRAINT_TYPE],
[C].[CONSTRAINT_NAME]
FROM [INFORMATION_SCHEMA].[KEY_COLUMN_USAGE] AS [C],
[INFORMATION_SCHEMA].[TABLE_CONSTRAINTS] AS [TABLE_CONSTRAINTS_1]
WHERE [TABLE_CONSTRAINTS_1].[CONSTRAINT_NAME] = [C].[CONSTRAINT_NAME] AND
[TABLE_CONSTRAINTS_1].[TABLE_SCHEMA] = [C].[TABLE_SCHEMA] AND
[C].[TABLE_NAME] = ? AND [C].[TABLE_SCHEMA] = ?
2013-06-06 11:50:11,424 INFO sqlalchemy.engine.base.Engine
(u'lancamentos_passivo', u'dbo')
2013-06-06 11:50:11,517 INFO sqlalchemy.engine.base.Engine SELECT
[C].[COLUMN_NAME], [R].[TABLE_SCHEMA], [R].[TABLE_NAME],
[R].[COLUMN_NAME], [REFERENTIAL_CONSTRAINTS_1].[CONSTRAINT_NAME],
[REFERENTIAL_CONSTRAINTS_1].[MATCH_OPTION],
[REFERENTIAL_CONSTRAINTS_1].[UPDATE_RULE],
[REFERENTIAL_CONSTRAINTS_1].[DELETE_RULE]
FROM [INFORMATION_SCHEMA].[KEY_COLUMN_USAGE] AS [C],
[INFORMATION_SCHEMA].[KEY_COLUMN_USAGE] AS [R],
[INFORMATION_SCHEMA].[REFERENTIAL_CONSTRAINTS] AS
[REFERENTIAL_CONSTRAINTS_1]
WHERE [C].[TABLE_NAME] = ? AND [C].[TABLE_SCHEMA] = ? AND
[C].[CONSTRAINT_NAME] = [REFERENTIAL_CONSTRAINTS_1].[CONSTRAINT_NAME] AND
[R].[CONSTRAINT_NAME] =
[REFERENTIAL_CONSTRAINTS_1].[UNIQUE_CONSTRAINT_NAME] AND
[C].[ORDINAL_POSITION] = [R].[ORDINAL_POSITION] ORDER BY
[REFERENTIAL_CONSTRAINTS_1].[CONSTRAINT_NAME], [R].[ORDINAL_POSITION]
2013-06-06 11:50:11,517 INFO sqlalchemy.engine.base.Engine
(u'lancamentos_passivo', u'dbo')
}}}
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2747>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-06 03:54:11
|
#2746: Add a flag to explicitly enable correlation even when the subquery has
`asfrom=True`
-------------------+-----------------------------------------
Reporter: sayap | Owner: zzzeek
Type: task | Status: new
Priority: low | Milestone:
Component: sql | Severity: no triage selected yet
Keywords: | Progress State: not decided upon
-------------------+-----------------------------------------
This is related to the mailing list post:
https://groups.google.com/forum/?fromgroups#!topic/sqlalchemy/Ld0iuCUphHU
It seems like #2668 has universally disabled correlation for subquery
inside a FROM clause. The situations where such expression is needed could
be quite rare, but it is sometimes necessary to do so, especially for
lesser databases such as SQL Server. An example would be this:
http://stackoverflow.com/questions/5786739/porting-postgresql-string-agg-
to-sql-server-problem-with-order-by
Another example would be a subquery that returns a couple of computed
values, with an outer query consists entirely of a CASE statement in its
select list that makes use of the values.
(Note that these examples are used in the context of hybrid / column
property)
I think it would be good to add a flag to `select()` to enforce the
correlation when necessary.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2746>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-05 21:42:12
|
#2745: PostgreSQL ARRAY of Enum doesn't create Enum types before creating table
-----------------------------------+------------------------------------
Reporter: glyphobet | Owner: zzzeek
Type: defect | Status: closed
Priority: medium | Milestone:
Component: postgres | Severity: no triage selected yet
Resolution: duplicate | Keywords:
Progress State: completed/closed |
-----------------------------------+------------------------------------
Comment (by glyphobet):
Cool, thanks. Nice to see that my workaround is similar to the one on
#2729. :)
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2745#comment:2>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-05 21:38:41
|
#2745: PostgreSQL ARRAY of Enum doesn't create Enum types before creating table
-----------------------------------+------------------------------------
Reporter: glyphobet | Owner: zzzeek
Type: defect | Status: closed
Priority: medium | Milestone:
Component: postgres | Severity: no triage selected yet
Resolution: duplicate | Keywords:
Progress State: completed/closed |
-----------------------------------+------------------------------------
Changes (by zzzeek):
* status: new => closed
* resolution: => duplicate
* status_field: awaiting triage => completed/closed
Comment:
hello -
this has already been logged as #2729. If you look there you can see a
workaround using events for now.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2745#comment:1>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|