summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/base.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2020-11-06 14:56:56 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2020-11-07 11:13:28 -0500
commit80be40300dfe33bdf75f61aaa0d5c48045886bb4 (patch)
treec8ec681e20d0967d434e511e737099f05ea6721a /lib/sqlalchemy/sql/base.py
parent8b9772de2dd9c9f1f01f96209d79ec1cd087b2fa (diff)
downloadsqlalchemy-80be40300dfe33bdf75f61aaa0d5c48045886bb4.tar.gz
Convert to autoload_with internally
Fixed bug where the now-deprecated ``autoload`` parameter was being called internally within the reflection routines when a related table were reflected. Fixes: #5684 Change-Id: I6ab439a2f49ff1ae2d3c7a15b531cbafbc3cf594
Diffstat (limited to 'lib/sqlalchemy/sql/base.py')
-rw-r--r--lib/sqlalchemy/sql/base.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/base.py b/lib/sqlalchemy/sql/base.py
index 4175fe89a..999169f90 100644
--- a/lib/sqlalchemy/sql/base.py
+++ b/lib/sqlalchemy/sql/base.py
@@ -875,7 +875,9 @@ class Executable(Generative):
"""Compile and execute this :class:`.Executable`."""
e = self.bind
if e is None:
- label = getattr(self, "description", self.__class__.__name__)
+ label = (
+ getattr(self, "description", None) or self.__class__.__name__
+ )
msg = (
"This %s is not directly bound to a Connection or Engine. "
"Use the .execute() method of a Connection or Engine "