[Sqlalchemy-tickets] Issue #3071: str/repr might be broken on RowProxy (zzzeek/sqlalchemy)
Brought to you by:
zzzeek
|
From: Dustin O. <iss...@bi...> - 2014-06-05 00:57:55
|
New issue 3071: str/repr might be broken on RowProxy https://bitbucket.org/zzzeek/sqlalchemy/issue/3071/str-repr-might-be-broken-on-rowproxy Dustin Oprea: There are some situations under which the str/repr representations of the returned records are malformed. However, I am unsure of the conditions. ``` #!python print("0: %s" % (record.__class__)) print("1: %s" % (str(record))) print("2: %s" % (repr(record))) print("3: %s" % (dict(record))) print("4: %s" % (record.items())) ``` When it works: ``` 0: <class 'sqlalchemy.engine.result.RowProxy'> 1: (5L, 'Dev Client (dustin)', 5L, 1L, '2019-05-27 23:11:47', 0L, 1L) 2: (5L, 'Dev Client (dustin)', 5L, 1L, '2019-05-27 23:11:47', 0L, 1L) 3: {u'certificate_validity_y': 5L, u'certificate_expire_timestamp': '2019-05-27 23:11:47', u'name': 'Dev Client (dustin)', u'can_proxy': 0L, u'is_admin': 1L, u'client_id': 5L, u'allow_api': 1L} 4: [(u'client_id', 5L), (u'name', 'Dev Client (dustin)'), (u'certificate_validity_y', 5L), (u'allow_api', 1L), (u'certificate_expire_timestamp', '2019-05-27 23:11:47'), (u'can_proxy', 0L), (u'is_admin', 1L)] ``` When it's broken: ``` 0: <class 'sqlalchemy.engine.result.RowProxy'> 1: (1L,) 2: (1L,) 3: {u'affected': 1L} 4: [(u'affected', 1L)] ``` I also used "xyz" as the column name, but it didn't make a difference: ``` 0: <class 'sqlalchemy.engine.result.RowProxy'> 1: (1L,) 2: (1L,) 3: {u'xyz': 1L} 4: [(u'xyz', 1L)] ``` I am using MySQL. It happens on latest (0.9.5). |