]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
warn for result.columns() method
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 21 Apr 2022 17:27:16 +0000 (13:27 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 21 Apr 2022 17:36:51 +0000 (13:36 -0400)
commitf1a409ecdd5f0377b9c00a859ab14e9005e873da
treecc175dc59f505e986904e93e8814d84fbb58b0c3
parentb41c3e7f56234b9873bbb547339b66fdcd10fd95
warn for result.columns() method

A warning is emitted when calling upon the :meth:`.Result.columns` method
with only one index, in particular ORM related cases, indicating that the
current behavior of :meth:`.Result.columns` is broken in this case and
will be changed in 2.0.  To receive a collection of scalar values,
use the :meth:`.Result.scalars` method.

Fixes: #7953
Change-Id: I3c4ca3eecc2bfc85ad1c38000e5990d6dde80d22
(cherry picked from commit fe2045fb1c767436ed1e32359fe005dabead504a)
doc/build/changelog/unreleased_14/7953.rst [new file with mode: 0644]
lib/sqlalchemy/engine/result.py
test/base/test_result.py