diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-10-12 13:16:14 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-10-12 13:57:43 -0400 |
commit | c76e3776f52d0d69c8c4932ba53626d7190cf5f4 (patch) | |
tree | 224282cf4390f136228a932a40dbb504824b273b /lib/sqlalchemy/sql/base.py | |
parent | 286fe9b0b165e46099066cc16552b93a0b853a7e (diff) | |
download | sqlalchemy-c76e3776f52d0d69c8c4932ba53626d7190cf5f4.tar.gz |
Deprecate bound metadata
The :paramref:`_schema.MetaData.bind` argument as well as the overall
concept of "bound metadata" is deprecated in SQLAlchemy 1.4 and will be
removed in SQLAlchemy 2.0. The parameter as well as related functions now
emit a :class:`_exc.RemovedIn20Warning` when :ref:`deprecation_20_mode` is
in use.
Added new parameter :paramref:`_automap.AutomapBase.prepare.autoload_with`
which supersedes :paramref:`_automap.AutomapBase.prepare.reflect`
and :paramref:`_automap.AutomapBase.prepare.engine`.
Fixes: #4634
Fixes: #5142
Change-Id: Iaabf9b481931e2fb68b97b5954c32e65772a298e
Diffstat (limited to 'lib/sqlalchemy/sql/base.py')
-rw-r--r-- | lib/sqlalchemy/sql/base.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/base.py b/lib/sqlalchemy/sql/base.py index f9b5ce7e1..93d6dcd84 100644 --- a/lib/sqlalchemy/sql/base.py +++ b/lib/sqlalchemy/sql/base.py @@ -1475,6 +1475,11 @@ class ColumnSet(util.ordered_column_set): def _bind_or_error(schemaitem, msg=None): + + util.warn_deprecated_20( + "The ``bind`` argument for schema methods that invoke SQL " + "against an engine or connection will be required in SQLAlchemy 2.0." + ) bind = schemaitem.bind if not bind: name = schemaitem.__class__.__name__ |