From a7b83bdd10e67b9d2948e755554292405240ff33 Mon Sep 17 00:00:00 2001 From: Matt Schuchhardt Date: Wed, 6 Mar 2019 10:28:48 -0500 Subject: [PATCH] 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 (cherry picked from commit 203de6946ef09b9fed2875491d2ac087a6dbfec6) --- doc/build/changelog/unreleased_12/4528.rst | 7 +++++++ examples/performance/large_resultsets.py | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 doc/build/changelog/unreleased_12/4528.rst 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(): -- 2.47.2