]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Fix large_resultsets performance example field name
authorMatt Schuchhardt <matt.schuchhardt@gmail.com>
Wed, 6 Mar 2019 15:28:48 +0000 (10:28 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 6 Mar 2019 15:34:17 +0000 (10:34 -0500)
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

doc/build/changelog/unreleased_12/4528.rst [new file with mode: 0644]
examples/performance/large_resultsets.py

diff --git a/doc/build/changelog/unreleased_12/4528.rst b/doc/build/changelog/unreleased_12/4528.rst
new file mode 100644 (file)
index 0000000..c117d0d
--- /dev/null
@@ -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.
index 2945040b5a8f4de7532456f4b663244d71c5643e..a5f99a283beae0e466eb6d15cb2e8f401a67eb2a 100644 (file)
@@ -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():