sqlalchemy-tickets Mailing List for SQLAlchemy (Page 63)
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...> - 2014-01-10 20:45:02
|
#2906: Unicode/UnicodeText return str instead of unicode on MySQL-Python 1.2.3
----------------------------------+------------------------------------
Reporter: stevejohnson | Owner:
Type: defect | Status: new
Priority: medium | Milestone:
Component: mysql | Severity: no triage selected yet
Resolution: | Keywords:
Progress State: awaiting triage |
----------------------------------+------------------------------------
Comment (by zzzeek):
see now that's a patch. I want to try seeing if i can backport that to
0.8 also. MySQL-python fixed the issue in this changeset:
https://github.com/farcepest/MySQLdb1/commit/cd44524fef63bd3fcb71947392326e9742d520e8
. It's of course only in some of their repos and is hardly documented at
all, but that's the code that fixes it. I was originally going to just do
a simple version check for 1.2.3, but as that commit says "I have no idea
how this works" in it and has no tests whatsoever, the patch I have here
adds the specific failure condition to test for, so if/when MySQL-python
regresses on this we won't be affected.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2906#comment:7>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-01-10 19:53:03
|
#2906: Unicode/UnicodeText return str instead of unicode on MySQL-Python 1.2.3
----------------------------------+------------------------------------
Reporter: stevejohnson | Owner:
Type: defect | Status: new
Priority: medium | Milestone:
Component: mysql | Severity: no triage selected yet
Resolution: | Keywords:
Progress State: awaiting triage |
----------------------------------+------------------------------------
Comment (by stevejohnson):
{{{#!sql
CREATE TABLE `demo_table` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`unicode_text` text COLLATE utf8_bin,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8 COLLATE=utf8_bin
}}}
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2906#comment:6>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-01-10 19:50:58
|
#2906: Unicode/UnicodeText return str instead of unicode on MySQL-Python 1.2.3
----------------------------------+------------------------------------
Reporter: stevejohnson | Owner:
Type: defect | Status: new
Priority: medium | Milestone:
Component: mysql | Severity: no triage selected yet
Resolution: | Keywords:
Progress State: awaiting triage |
----------------------------------+------------------------------------
Comment (by zzzeek):
whats the "SHOW CREATE TABLE" you have for that table ?
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2906#comment:5>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-01-10 19:45:06
|
#2906: Unicode/UnicodeText return str instead of unicode on MySQL-Python 1.2.3
----------------------------------+------------------------------------
Reporter: stevejohnson | Owner:
Type: defect | Status: new
Priority: medium | Milestone:
Component: mysql | Severity: no triage selected yet
Resolution: | Keywords:
Progress State: awaiting triage |
----------------------------------+------------------------------------
Comment (by stevejohnson):
I agree that it's weird. It may take me some time to get to the bottom of
things but I'll do my best.
For now, here's the debug output of my original demo:
{{{
2014-01-10 11:41:17,010 INFO sqlalchemy.engine.base.Engine SELECT
DATABASE()
2014-01-10 11:41:17,012 INFO sqlalchemy.engine.base.Engine ()
2014-01-10 11:41:17,012 DEBUG sqlalchemy.engine.base.Engine Col
('DATABASE()',)
2014-01-10 11:41:17,013 DEBUG sqlalchemy.engine.base.Engine Row
(u'graffiti_world_services',)
2014-01-10 11:41:17,015 INFO sqlalchemy.engine.base.Engine SHOW VARIABLES
LIKE 'character_set%%'
2014-01-10 11:41:17,018 INFO sqlalchemy.engine.base.Engine ()
2014-01-10 11:41:17,019 DEBUG sqlalchemy.engine.base.Engine Col
('Variable_name', 'Value')
2014-01-10 11:41:17,019 DEBUG sqlalchemy.engine.base.Engine Row
(u'character_set_client', u'utf8')
2014-01-10 11:41:17,019 DEBUG sqlalchemy.engine.base.Engine Row
(u'character_set_connection', u'utf8')
2014-01-10 11:41:17,020 DEBUG sqlalchemy.engine.base.Engine Row
(u'character_set_database', u'utf8')
2014-01-10 11:41:17,020 DEBUG sqlalchemy.engine.base.Engine Row
(u'character_set_filesystem', u'binary')
2014-01-10 11:41:17,020 DEBUG sqlalchemy.engine.base.Engine Row
(u'character_set_results', u'utf8')
### could this be related? ###
2014-01-10 11:41:17,020 DEBUG sqlalchemy.engine.base.Engine Row
(u'character_set_server', u'latin1')
###
2014-01-10 11:41:17,020 DEBUG sqlalchemy.engine.base.Engine Row
(u'character_set_system', u'utf8')
2014-01-10 11:41:17,020 DEBUG sqlalchemy.engine.base.Engine Row
(u'character_sets_dir', u'/usr/share/mysql/charsets/')
2014-01-10 11:41:17,021 INFO sqlalchemy.engine.base.Engine SHOW VARIABLES
LIKE 'sql_mode'
2014-01-10 11:41:17,021 INFO sqlalchemy.engine.base.Engine ()
2014-01-10 11:41:17,021 DEBUG sqlalchemy.engine.base.Engine Col
('Variable_name', 'Value')
2014-01-10 11:41:17,021 DEBUG sqlalchemy.engine.base.Engine Row
(u'sql_mode', u'STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION')
2014-01-10 11:41:17,022 INFO sqlalchemy.engine.base.Engine DESCRIBE
`demo_table`
2014-01-10 11:41:17,022 INFO sqlalchemy.engine.base.Engine ()
2014-01-10 11:41:17,023 DEBUG sqlalchemy.engine.base.Engine Col ('Field',
'Type', 'Null', 'Key', 'Default', 'Extra')
2014-01-10 11:41:17,024 DEBUG sqlalchemy.engine.base.Engine Row (u'id',
u'int(11)', u'NO', u'PRI', None, u'auto_increment')
2014-01-10 11:41:17,025 INFO sqlalchemy.engine.base.Engine BEGIN
(implicit)
2014-01-10 11:41:17,026 INFO sqlalchemy.engine.base.Engine INSERT INTO
demo_table (unicode_text) VALUES (%s)
2014-01-10 11:41:17,029 INFO sqlalchemy.engine.base.Engine ('What a lovely
day',)
MySQL2014-01-10 11:41:17,030 INFO sqlalchemy.engine.base.Engine SELECT
version() AS version_1
2014-01-10 11:41:17,030 INFO sqlalchemy.engine.base.Engine ()
2014-01-10 11:41:17,030 DEBUG sqlalchemy.engine.base.Engine Col
('version_1',)
2014-01-10 11:41:17,031 DEBUG sqlalchemy.engine.base.Engine Row
(u'5.6.13-2+debphp.org~precise+2',)
5.6.13-2+debphp.org~precise+2
sqlalchemy 0.8.4
MySQL-Python 1.2.3
2014-01-10 11:41:17,032 INFO sqlalchemy.engine.base.Engine SELECT
demo_table.id AS demo_table_id, demo_table.unicode_text AS
demo_table_unicode_text
FROM demo_table
LIMIT %s
2014-01-10 11:41:17,032 INFO sqlalchemy.engine.base.Engine (1,)
2014-01-10 11:41:17,033 DEBUG sqlalchemy.engine.base.Engine Col
('demo_table_id', 'demo_table_unicode_text')
2014-01-10 11:41:17,033 DEBUG sqlalchemy.engine.base.Engine Row (21L,
'What a lovely day')
<type 'str'>
}}}
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2906#comment:4>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-01-10 19:33:48
|
#2906: Unicode/UnicodeText return str instead of unicode on MySQL-Python 1.2.3
----------------------------------+------------------------------------
Reporter: stevejohnson | Owner:
Type: defect | Status: new
Priority: medium | Milestone:
Component: mysql | Severity: no triage selected yet
Resolution: | Keywords:
Progress State: awaiting triage |
----------------------------------+------------------------------------
Comment (by zzzeek):
OK can you see why that's weird? thats the raw MySQL cursor, on 1.2.3,
giving you "unicode". Can you track down what is specifically making it
not return "unicode" for this one column in your test script? turning on
echo='debug' in create_engine() will show you the data coming back.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2906#comment:3>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-01-10 19:27:55
|
#2906: Unicode/UnicodeText return str instead of unicode on MySQL-Python 1.2.3
----------------------------------+------------------------------------
Reporter: stevejohnson | Owner:
Type: defect | Status: new
Priority: medium | Milestone:
Component: mysql | Severity: no triage selected yet
Resolution: | Keywords:
Progress State: awaiting triage |
----------------------------------+------------------------------------
Comment (by stevejohnson):
I get the same output as you.
{{{
<type 'unicode'>
<type 'unicode'>
}}}
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2906#comment:2>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-01-10 19:18:16
|
#2906: Unicode/UnicodeText return str instead of unicode on MySQL-Python 1.2.3
----------------------------------+------------------------------------
Reporter: stevejohnson | Owner:
Type: defect | Status: new
Priority: medium | Milestone:
Component: mysql | Severity: no triage selected yet
Resolution: | Keywords:
Progress State: awaiting triage |
----------------------------------+------------------------------------
Comment (by zzzeek):
ok here's the one way this can go wrong. try out this script:
{{{
#!python
from sqlalchemy import create_engine
from sqlalchemy.sql import expression
from sqlalchemy import types as sqltypes
engine = create_engine("mysql://scott:tiger@localhost/test?charset=utf8")
dialect = engine.dialect
connection = engine.connect()
cursor = connection.connection.cursor()
def ret_type(type_):
cursor.execute(
str(
expression.select(
[expression.cast(
expression.literal_column(
"'test plain returns'"),
type_)
]).compile(dialect=dialect)
)
)
row = cursor.fetchone()
print type(row[0])
ret_type(sqltypes.VARCHAR(60))
ret_type(sqltypes.TEXT)
}}}
if the two types printed out aren't consistent, that could cause this
issue. MySQL-python 1.2.3 for me here reports "unicode" for both.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2906#comment:1>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-01-10 19:09:03
|
#2906: Unicode/UnicodeText return str instead of unicode on MySQL-Python 1.2.3
--------------------------+-----------------------------------------
Reporter: stevejohnson | Owner:
Type: defect | Status: new
Priority: medium | Milestone:
Component: mysql | Severity: no triage selected yet
Keywords: | Progress State: awaiting triage
--------------------------+-----------------------------------------
I recently tried to use a `UnicodeText` column and was surprised to find
that it was giving me `str` values. Upgrading MySQL-Python to 1.2.5 (1.2.4
works too) resulted in getting the correct `unicode` values.
Here's a short test script:
{{{#!python
import sqlalchemy
import MySQLdb
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm.session import Session
Base = declarative_base()
class DemoTable(Base):
__tablename__ = 'demo_table'
id = sqlalchemy.Column(sqlalchemy.Integer(), primary_key=True)
unicode_text = sqlalchemy.Column(sqlalchemy.UnicodeText())
engine = sqlalchemy.create_engine('mysql://something?charset=utf8')
Base.metadata.create_all(bind=engine)
session = Session(bind=engine)
session.add(DemoTable(unicode_text=u"What a lovely day"))
session.flush()
session.expire_all()
print 'MySQL', session.query(sqlalchemy.func.version()).one()[0]
print 'sqlalchemy', sqlalchemy.__version__
print 'MySQL-Python', MySQLdb.__version__
print type(session.query(DemoTable).first().unicode_text)
}}}
I tested on v0.8.2-v0.9.1. The output below is the same for all except for
the sqlalchemy version number.
{{{
MySQL 5.6.13-2+debphp.org~precise+2
sqlalchemy 0.8.2
MySQL-Python 1.2.3
<type 'str'>
}}}
{{{
MySQL 5.6.13-2+debphp.org~precise+2
sqlalchemy 0.8.2
MySQL-Python 1.2.4
<type 'unicode'>
}}}
{{{
MySQL 5.6.13-2+debphp.org~precise+2
sqlalchemy 0.8.2
MySQL-Python 1.2.5
<type 'unicode'>
}}}
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2906>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-01-04 16:00:30
|
#2671: in place codebase for py2x, py3x
-----------------------------------+--------------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: task | Status: closed
Priority: medium | Milestone: 0.9.0
Component: (none) | Severity: refactor - over two days
Resolution: fixed | Keywords:
Progress State: completed/closed |
-----------------------------------+--------------------------------------
Comment (by dwt):
Thanks! I'll take a look at that!
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2671#comment:4>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-01-04 05:37:51
|
#2905: Attempting to use a partial() instance as an event listener causes infinite
recursion
-----------------------------------+----------------------------------
Reporter: agronholm | Owner: zzzeek
Type: defect | Status: closed
Priority: medium | Milestone: 0.9.xx
Component: utils | Severity: minor - half an hour
Resolution: fixed | Keywords:
Progress State: completed/closed |
-----------------------------------+----------------------------------
Changes (by zzzeek):
* status: new => closed
* status_field: awaiting triage => completed/closed
* resolution: => fixed
* severity: no triage selected yet => minor - half an hour
* milestone: => 0.9.xx
Comment:
OK, not much we can do with that besides skip the check, but the check
there isn't critical in the majority of cases. it's explained in the
changelog. rc450cd6cb6d0c8fed110abc
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2905#comment:2>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-01-04 04:20:07
|
#2905: Attempting to use a partial() instance as an event listener causes infinite
recursion
----------------------------------+------------------------------------
Reporter: agronholm | Owner: zzzeek
Type: defect | Status: new
Priority: medium | Milestone:
Component: utils | Severity: no triage selected yet
Resolution: | Keywords:
Progress State: awaiting triage |
----------------------------------+------------------------------------
Comment (by agronholm):
An even greater mystery is why I didn't pass the arguments as kwargs to
listen() itself in the first place.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2905#comment:1>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-01-04 04:16:26
|
#2905: Attempting to use a partial() instance as an event listener causes infinite
recursion
-----------------------+-----------------------------------------
Reporter: agronholm | Owner: zzzeek
Type: defect | Status: new
Priority: medium | Milestone:
Component: utils | Severity: no triage selected yet
Keywords: | Progress State: awaiting triage
-----------------------+-----------------------------------------
I had this line in my app fail due to infinite recursion:
{{{
event.listen(session, 'after_commit', partial(self.publish_events,
models=tuple(models_changed)))
}}}
This is a regression from 0.8.4. I haven't tested with 0.9.0b1.
The simplest way to reproduce this is:
{{{
>>> from functools import partial
>>> from sqlalchemy.util import get_callable_argspec
>>> p = partial(print, 'b')
>>> get_callable_argspec(p)
....
File "/home/alex/virtualenv/triancore/lib/python3.3/site-
packages/sqlalchemy/util/langhelpers.py", line 272,
in get_callable_argspec
return get_callable_argspec(fn.__call__)
File "/home/alex/virtualenv/triancore/lib/python3.3/site-
packages/sqlalchemy/util/langhelpers.py", line 264,
in get_callable_argspec
if isinstance(fn, types.FunctionType):
RuntimeError: maximum recursion depth exceeded while calling a Python
object
}}}
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2905>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-01-03 16:51:44
|
#2671: in place codebase for py2x, py3x
-----------------------------------+--------------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: task | Status: closed
Priority: medium | Milestone: 0.9.0
Component: (none) | Severity: refactor - over two days
Resolution: fixed | Keywords:
Progress State: completed/closed |
-----------------------------------+--------------------------------------
Comment (by zzzeek):
well I didn't do exactly what Armin talks about here:
http://lucumr.pocoo.org/2013/5/21/porting-to-python-3-redux/ though
that's kind of the background. I started with the 2to3 version of the
code, and then cleaned it up. This approach has some major issues which
is that a lot of the 2to3 fixes are not what we want, and are very hard to
search and replace, most notably it turning "basestring" into "str".
#2901 is an example of one I missed, causing a regression. 2to3 allows
custom fixers which is probably what "python-modernize" is doing. Unlike
Armin I'm still trying to keep 3.1/3.2 working so I had to do some more
work with strings.
the best approach would probably be something like starting out with your
"compat" layer, which you definitely need (ours is
sqlalchemy/util/compat.py) and then rigging up a 2to3-like tool that
writes out your "compat".
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2671#comment:3>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-01-03 16:23:24
|
#2671: in place codebase for py2x, py3x
-----------------------------------+--------------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: task | Status: closed
Priority: medium | Milestone: 0.9.0
Component: (none) | Severity: refactor - over two days
Resolution: fixed | Keywords:
Progress State: completed/closed |
-----------------------------------+--------------------------------------
Comment (by dwt):
Out of interest, do you have a link that describes the practices you
followed to achieve this? I'd imagine that this could be a good template
for our efforts. :-)
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2671#comment:2>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-01-03 02:49:00
|
#2904: docuemnt foreignkeyconstraint elements, columns
---------------------------+----------------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: defect | Status: new
Priority: high | Milestone: 0.9.xx
Component: documentation | Severity: trivial - <10 minutes
Keywords: | Progress State: in queue
---------------------------+----------------------------------------
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2904>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-01-03 00:00:22
|
#2901: unicode backrefs broken on python 2
-----------------------------------+-----------------------------------
Reporter: gazpachoking | Owner: zzzeek
Type: defect | Status: closed
Priority: highest | Milestone: 0.9.xx
Component: orm | Severity: trivial - <10 minutes
Resolution: fixed | Keywords:
Progress State: completed/closed |
-----------------------------------+-----------------------------------
Changes (by zzzeek):
* status: new => closed
* resolution: => fixed
* severity: minor - half an hour => trivial - <10 minutes
* status_field: in queue => completed/closed
Comment:
r6d3e563a575bcdc57c966980abc5038337
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2901#comment:4>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-01-02 23:53:33
|
#2900: relationship aliased on subclass causes infinite recursion
-----------------------------------+-------------------------------
Reporter: scraper | Owner: zzzeek
Type: defect | Status: closed
Priority: highest | Milestone: 0.9.xx
Component: orm | Severity: major - 1-3 hours
Resolution: fixed | Keywords:
Progress State: completed/closed |
-----------------------------------+-------------------------------
Changes (by zzzeek):
* status: new => closed
* resolution: => fixed
* status_field: in queue => completed/closed
Comment:
changed my mind on the key being strong enough based on some existing
tests. r8a7fdd4e5cf5e4d9ba71c66a
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2900#comment:7>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-01-02 23:27:19
|
#2903: auto-aliasing for cls->joined-inh only considers the previous class
-----------------------------------+----------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: defect | Status: closed
Priority: highest | Milestone: 0.9.xx
Component: orm | Severity: minor - half an hour
Resolution: fixed | Keywords:
Progress State: completed/closed |
-----------------------------------+----------------------------------
Changes (by zzzeek):
* status: new => closed
* resolution: => fixed
* status_field: needs tests => completed/closed
Comment:
rca8fca63916897f1bbc2fa4f1e
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2903#comment:2>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-01-02 21:52:17
|
#2903: auto-aliasing for cls->joined-inh only considers the previous class
------------------------------+----------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: defect | Status: new
Priority: highest | Milestone: 0.9.xx
Component: orm | Severity: minor - half an hour
Resolution: | Keywords:
Progress State: needs tests |
------------------------------+----------------------------------
Changes (by zzzeek):
* severity: major - 1-3 hours => minor - half an hour
* status_field: in progress => needs tests
Comment:
patch:
{{{
#!diff
diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py
index 4f10a6a..b1916b9 100644
--- a/lib/sqlalchemy/orm/query.py
+++ b/lib/sqlalchemy/orm/query.py
@@ -1847,9 +1847,13 @@ class Query(object):
l_info = inspect(left)
r_info = inspect(right)
- overlap = not create_aliases and \
- sql_util.selectables_overlap(l_info.selectable,
- r_info.selectable)
+ overlap = False
+ if not create_aliases:
+ for from_obj in self._from_obj or [l_info.selectable]:
+ if sql_util.selectables_overlap(from_obj,
r_info.selectable):
+ overlap = True
+ break
+
if overlap and l_info.selectable is r_info.selectable:
raise sa_exc.InvalidRequestError(
"Can't join table/selectable '%s' to itself" %
}}}
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2903#comment:1>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-01-02 21:41:30
|
#2903: auto-aliasing for cls->joined-inh only considers the previous class
---------------------+------------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: defect | Status: new
Priority: highest | Milestone: 0.9.xx
Component: orm | Severity: major - 1-3 hours
Keywords: | Progress State: in progress
---------------------+------------------------------------
I thought the auto-aliasing from query(B).join(B.cs) if C were joined-inh
was removed. but it's not. so now it only takes into account the
immediate joinpoint, and fails in a case like this:
{{{
#!python
from sqlalchemy import *
from sqlalchemy.orm import *
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class A(Base):
__tablename__ = 'a'
id = Column(Integer, primary_key=True)
class B(A):
__tablename__ = 'b'
id = Column(Integer, ForeignKey('a.id'), primary_key=True)
c_id = Column(Integer, ForeignKey('c.id'))
c = relationship("C", foreign_keys=c_id)
class C(A):
__tablename__ = 'c'
id = Column(Integer, ForeignKey('a.id'), primary_key=True)
d_id = Column(Integer, ForeignKey('d.id'))
d = relationship("D", foreign_keys=d_id)
class D(A):
__tablename__ = 'd'
id = Column(Integer, ForeignKey('a.id'), primary_key=True)
e_id = Column(Integer, ForeignKey('e.id'))
e = relationship("E", foreign_keys=e_id)
class E(A):
__tablename__ = 'e'
id = Column(Integer, ForeignKey('a.id'), primary_key=True)
f_id = Column(Integer, ForeignKey('f.id'))
f = relationship("F", foreign_keys=f_id)
class F(A):
__tablename__ = 'f'
id = Column(Integer, ForeignKey('a.id'), primary_key=True)
e = create_engine("postgresql://scott:tiger@localhost/test", echo=True)
Base.metadata.create_all(e)
s = Session(e)
s.query(B).join("c", "d", "e", "f").all()
}}}
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2903>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-01-02 18:17:05
|
#2902: document table.constraints
--------------------------------+-----------------------------------
Reporter: sorcererofdm | Owner: zzzeek
Type: enhancement | Status: new
Priority: medium | Milestone: 0.9.xx
Component: documentation | Severity: trivial - <10 minutes
Resolution: | Keywords:
Progress State: in queue |
--------------------------------+-----------------------------------
Comment (by zzzeek):
I'll definitely add docstrings, I do that by placing a class-level
variable with a doc that is set to `None`. Carry on !
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2902#comment:4>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-01-02 17:42:37
|
#2902: document table.constraints
--------------------------------+-----------------------------------
Reporter: sorcererofdm | Owner: zzzeek
Type: enhancement | Status: new
Priority: medium | Milestone: 0.9.xx
Component: documentation | Severity: trivial - <10 minutes
Resolution: | Keywords:
Progress State: in queue |
--------------------------------+-----------------------------------
Comment (by sorcererofdm):
I see. When I filed the ticket it was very late night/early morning so my
head wasn't exactly straight. Should've looked at the instance level
attributes.
But anyhow it seems to make sense to expose things like `indexes` and
`constraints` if `foreign_keys` is mentioned in the docs. At least a
sentence or 2 in the tutorial.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2902#comment:3>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-01-02 14:57:37
|
#2902: document table.constraints
--------------------------------+-----------------------------------
Reporter: sorcererofdm | Owner: zzzeek
Type: enhancement | Status: new
Priority: medium | Milestone: 0.9.xx
Component: documentation | Severity: trivial - <10 minutes
Resolution: | Keywords:
Progress State: in queue |
--------------------------------+-----------------------------------
Comment (by zzzeek):
also the ForeignKey objects, which are the components of a
ForeignKeyConstraint, are at
http://docs.sqlalchemy.org/en/rel_0_9/core/metadata.html?highlight=table#sqlalchemy.schema.Table.foreign_keys.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2902#comment:2>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-01-02 14:56:36
|
#2902: document table.constraints
--------------------------------+-----------------------------------
Reporter: sorcererofdm | Owner: zzzeek
Type: enhancement | Status: new
Priority: medium | Milestone: 0.9.xx
Component: documentation | Severity: trivial - <10 minutes
Resolution: | Keywords:
Progress State: in queue |
--------------------------------+-----------------------------------
Changes (by zzzeek):
* severity: no triage selected yet => trivial - <10 minutes
* component: schema => documentation
* priority: low => medium
* milestone: => 0.9.xx
* status_field: awaiting triage => in queue
Comment:
its table.constraints. seems like there's no docstring for that since
its just an instance level attribute.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2902#comment:1>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-01-02 06:35:25
|
#2902: Expose Table._sorted_constraints
--------------------------+-----------------------------------------
Reporter: sorcererofdm | Owner: zzzeek
Type: enhancement | Status: new
Priority: low | Milestone:
Component: schema | Severity: no triage selected yet
Keywords: | Progress State: awaiting triage
--------------------------+-----------------------------------------
I was trying to temporarily disable foreign keys for replication, but for
the life of me couldn't find how to get the set of ForeignKeyConstraint
objects from either Inspector, MetaData, or Table, for the longest time.
There's nothing on it from google.
Perhaps it should be exposed in the docs. Are there any reason it is
private?
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2902>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|