summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/util
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2020-10-16 12:03:11 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2020-10-16 19:15:58 -0400
commit5162f2bc5fc0ac239f26a76fc9f0c2c2472adf60 (patch)
tree1ca6d556c17a8cfade13210ba13f1663040bfbb7 /lib/sqlalchemy/util
parent41d3e16773e84692b6625ccb67da204b5362d9c3 (diff)
downloadsqlalchemy-5162f2bc5fc0ac239f26a76fc9f0c2c2472adf60.tar.gz
Add deprecation for base Executable.bind
These attributes will be removed in SQLAlchemy 2.0. Also alters the deprecation message to qualify the type of object correctly. this in turn requires changes in the warnings filter and deprecation tests. Change-Id: I5779d9813e88f42e5db0c7b5e3ffff1d1535c203
Diffstat (limited to 'lib/sqlalchemy/util')
-rw-r--r--lib/sqlalchemy/util/deprecations.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/sqlalchemy/util/deprecations.py b/lib/sqlalchemy/util/deprecations.py
index 83037bbff..9f0ca0b1a 100644
--- a/lib/sqlalchemy/util/deprecations.py
+++ b/lib/sqlalchemy/util/deprecations.py
@@ -162,9 +162,17 @@ def moved_20(message, **kw):
def deprecated_20(api_name, alternative=None, **kw):
+ type_reg = re.match("^:(attr|func|meth):", api_name)
+ if type_reg:
+ type_ = {"attr": "attribute", "func": "function", "meth": "method"}[
+ type_reg.group(1)
+ ]
+ else:
+ type_ = "construct"
message = (
- "The %s function/method is considered legacy as of the "
- "1.x series of SQLAlchemy and will be removed in 2.0." % api_name
+ "The %s %s is considered legacy as of the "
+ "1.x series of SQLAlchemy and will be removed in 2.0."
+ % (api_name, type_)
)
if alternative: