summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r--lib/sqlalchemy/engine/reflection.py2
-rw-r--r--lib/sqlalchemy/ext/declarative/extensions.py1
-rw-r--r--lib/sqlalchemy/orm/decl_base.py4
-rw-r--r--lib/sqlalchemy/sql/base.py4
-rw-r--r--lib/sqlalchemy/testing/suite/test_reflection.py12
-rw-r--r--lib/sqlalchemy/testing/warnings.py2
6 files changed, 15 insertions, 10 deletions
diff --git a/lib/sqlalchemy/engine/reflection.py b/lib/sqlalchemy/engine/reflection.py
index daebfe263..5770eab8c 100644
--- a/lib/sqlalchemy/engine/reflection.py
+++ b/lib/sqlalchemy/engine/reflection.py
@@ -966,7 +966,6 @@ class Inspector(object):
sa_schema.Table(
referred_table,
table.metadata,
- autoload=True,
schema=referred_schema,
autoload_with=self.bind,
_extend_on=_extend_on,
@@ -981,7 +980,6 @@ class Inspector(object):
sa_schema.Table(
referred_table,
table.metadata,
- autoload=True,
autoload_with=self.bind,
schema=sa_schema.BLANK_SCHEMA,
_extend_on=_extend_on,
diff --git a/lib/sqlalchemy/ext/declarative/extensions.py b/lib/sqlalchemy/ext/declarative/extensions.py
index 0b9a6f7ed..1f0c82471 100644
--- a/lib/sqlalchemy/ext/declarative/extensions.py
+++ b/lib/sqlalchemy/ext/declarative/extensions.py
@@ -449,7 +449,6 @@ class DeferredReflection(object):
table.metadata,
extend_existing=True,
autoload_replace=False,
- autoload=True,
autoload_with=inspector,
schema=table.schema,
)
diff --git a/lib/sqlalchemy/orm/decl_base.py b/lib/sqlalchemy/orm/decl_base.py
index 35da39c9f..0649247a7 100644
--- a/lib/sqlalchemy/orm/decl_base.py
+++ b/lib/sqlalchemy/orm/decl_base.py
@@ -635,6 +635,10 @@ class _ClassScanMapperConfig(_MapperConfig):
else:
args = table_args
+ autoload_with = dict_.get("__autoload_with__")
+ if autoload_with:
+ table_kw["autoload_with"] = autoload_with
+
autoload = dict_.get("__autoload__")
if autoload:
table_kw["autoload"] = True
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 "
diff --git a/lib/sqlalchemy/testing/suite/test_reflection.py b/lib/sqlalchemy/testing/suite/test_reflection.py
index 49aafa879..3e4d7a2c0 100644
--- a/lib/sqlalchemy/testing/suite/test_reflection.py
+++ b/lib/sqlalchemy/testing/suite/test_reflection.py
@@ -1326,13 +1326,17 @@ class NormalizedNameTest(fixtures.TablesTest):
def test_reflect_lowercase_forced_tables(self):
- m2 = MetaData(testing.db)
- t2_ref = Table(quoted_name("t2", quote=True), m2, autoload=True)
+ m2 = MetaData()
+ t2_ref = Table(
+ quoted_name("t2", quote=True), m2, autoload_with=testing.db
+ )
t1_ref = m2.tables["t1"]
assert t2_ref.c.t1id.references(t1_ref.c.id)
- m3 = MetaData(testing.db)
- m3.reflect(only=lambda name, m: name.lower() in ("t1", "t2"))
+ m3 = MetaData()
+ m3.reflect(
+ testing.db, only=lambda name, m: name.lower() in ("t1", "t2")
+ )
assert m3.tables["t2"].c.t1id.references(m3.tables["t1"].c.id)
def test_get_table_names(self):
diff --git a/lib/sqlalchemy/testing/warnings.py b/lib/sqlalchemy/testing/warnings.py
index cf88a70c4..2a0be42c1 100644
--- a/lib/sqlalchemy/testing/warnings.py
+++ b/lib/sqlalchemy/testing/warnings.py
@@ -58,8 +58,6 @@ def setup_filters():
"dictionaries only.",
r"The Connection.connect\(\) method is considered legacy",
r".*DefaultGenerator.execute\(\)",
- r"The autoload parameter is deprecated and will be removed ",
- #
#
# bound metadaa
#