From: Matt Schuchhardt Date: Wed, 6 Mar 2019 15:28:48 +0000 (-0500) Subject: Fix large_resultsets performance example field name X-Git-Tag: rel_1_3_1~7^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=203de6946ef09b9fed2875491d2ac087a6dbfec6;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Fix large_resultsets performance example field name Fixed bug in large_resultsets example case where a re-named "id" variable due to code reformatting caused the test to fail. Pull request courtesy Matt Schuchhardt. Fixes: #4528 Closes: #4529 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4529 Pull-request-sha: 8f52f10422114c397254db9e6f940d042708e0bd Change-Id: Iaca6fd06ec0ede8ff1745d627708ba492a2114c8 --- diff --git a/doc/build/changelog/unreleased_12/4528.rst b/doc/build/changelog/unreleased_12/4528.rst new file mode 100644 index 0000000000..c117d0d5cc --- /dev/null +++ b/doc/build/changelog/unreleased_12/4528.rst @@ -0,0 +1,7 @@ +.. change:: + :tags: bug, examples + :tickets: 4528 + + Fixed bug in large_resultsets example case where a re-named "id" variable + due to code reformatting caused the test to fail. Pull request courtesy + Matt Schuchhardt. diff --git a/examples/performance/large_resultsets.py b/examples/performance/large_resultsets.py index 2945040b5a..a5f99a283b 100644 --- a/examples/performance/large_resultsets.py +++ b/examples/performance/large_resultsets.py @@ -170,7 +170,7 @@ def _test_dbapi_raw(n, make_objects): # ORM land anyway :) class SimpleCustomer(object): def __init__(self, id_, name, description): - self.id = id_ + self.id_ = id_ self.name = name self.description = description @@ -184,7 +184,7 @@ def _test_dbapi_raw(n, make_objects): for row in cursor.fetchall(): # ensure that we fully fetch! customer = SimpleCustomer( - id=row[0], name=row[1], description=row[2] + id_=row[0], name=row[1], description=row[2] ) else: for row in cursor.fetchall():