summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/mssql/base.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2019-01-25 11:36:54 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2019-01-25 11:36:54 -0500
commit5e48f8445c33a45ba36c9612f52fcaeca5edd27f (patch)
treebb5443231042b76204106dffc3c59446a2f93604 /lib/sqlalchemy/dialects/mssql/base.py
parent9331613fc83c3b1b428dc7b8ef44ed4e9b1973da (diff)
downloadsqlalchemy-5e48f8445c33a45ba36c9612f52fcaeca5edd27f.tar.gz
Fix mssql quote schema warning
The deprecations review didn't include tests of identifier_preparer.quote.force for backends, so MSSQL slipped through. We have to fully reimplement the deprecation warning here so that it passes tests which are now enabled for all backends. Change-Id: I9d07e6766e16b5a35b7f7566f1daf94b04346270
Diffstat (limited to 'lib/sqlalchemy/dialects/mssql/base.py')
-rw-r--r--lib/sqlalchemy/dialects/mssql/base.py20
1 files changed, 15 insertions, 5 deletions
diff --git a/lib/sqlalchemy/dialects/mssql/base.py b/lib/sqlalchemy/dialects/mssql/base.py
index 5c446341c..4a83c0854 100644
--- a/lib/sqlalchemy/dialects/mssql/base.py
+++ b/lib/sqlalchemy/dialects/mssql/base.py
@@ -2019,14 +2019,24 @@ class MSIdentifierPreparer(compiler.IdentifierPreparer):
def quote_schema(self, schema, force=None):
"""Prepare a quoted table and schema name."""
+ # need to re-implement the deprecation warning entirely
+ if force is not None:
+ # not using the util.deprecated_params() decorator in this
+ # case because of the additional function call overhead on this
+ # very performance-critical spot.
+ util.warn_deprecated(
+ "The IdentifierPreparer.quote_schema.force parameter is "
+ "deprecated and will be removed in a future release. This "
+ "flag has no effect on the behavior of the "
+ "IdentifierPreparer.quote method; please refer to "
+ "quoted_name()."
+ )
+
dbname, owner = _schema_elements(schema)
if dbname:
- result = "%s.%s" % (
- self.quote(dbname, force),
- self.quote(owner, force),
- )
+ result = "%s.%s" % (self.quote(dbname), self.quote(owner))
elif owner:
- result = self.quote(owner, force)
+ result = self.quote(owner)
else:
result = ""
return result