summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/engine/reflection.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2018-12-20 22:05:36 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2019-01-23 18:10:06 -0500
commit4c2c2c40fde17c85013e00a6f3303a99e2b32c12 (patch)
tree324a2c22eb61cb913e3e162e163f7baff14152cf /lib/sqlalchemy/engine/reflection.py
parent5832f7172907a8151345d95061f93784ce4bb9b1 (diff)
downloadsqlalchemy-4c2c2c40fde17c85013e00a6f3303a99e2b32c12.tar.gz
Add deprecation warnings to all deprecated APIs
A large change throughout the library has ensured that all objects, parameters, and behaviors which have been noted as deprecated or legacy now emit ``DeprecationWarning`` warnings when invoked. As the Python 3 interpreter now defaults to displaying deprecation warnings, as well as that modern test suites based on tools like tox and pytest tend to display deprecation warnings, this change should make it easier to note what API features are obsolete. See the notes added to the changelog and migration notes for further details. Fixes: #4393 Change-Id: If0ea11a1fc24f9a8029352eeadfc49a7a54c0a1b
Diffstat (limited to 'lib/sqlalchemy/engine/reflection.py')
-rw-r--r--lib/sqlalchemy/engine/reflection.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/sqlalchemy/engine/reflection.py b/lib/sqlalchemy/engine/reflection.py
index 4e4ddab6d..14d647b9a 100644
--- a/lib/sqlalchemy/engine/reflection.py
+++ b/lib/sqlalchemy/engine/reflection.py
@@ -160,6 +160,16 @@ class Inspector(object):
)
return []
+ @util.deprecated_params(
+ order_by=(
+ "1.0",
+ "The :paramref:`get_table_names.order_by` parameter is deprecated "
+ "and will be removed in a future release. Please refer to "
+ ":meth:`.Inspector.get_sorted_table_and_fkc_names` for a "
+ "more comprehensive solution to resolving foreign key cycles "
+ "between tables.",
+ )
+ )
def get_table_names(self, schema=None, order_by=None):
"""Return all table names in referred to within a particular schema.
@@ -179,14 +189,6 @@ class Inspector(object):
resolve cycles, and will raise :class:`.CircularDependencyError`
if cycles exist.
- .. deprecated:: 1.0
-
- The :paramref:`get_table_names.order_by` parameter is deprecated
- and will be removed in a future release. Please refer to
- :meth:`.Inspector.get_sorted_table_and_fkc_names` for a
- more comprehensive solution to resolving foreign key cycles
- between tables.
-
.. seealso::
:meth:`.Inspector.get_sorted_table_and_fkc_names`
@@ -380,7 +382,7 @@ class Inspector(object):
"0.7",
"The :meth:`.Inspector.get_primary_keys` method is deprecated and "
"will be removed in a future release. Please refer to the "
- ":meth:`.Inspector.get_pk_constraint` method."
+ ":meth:`.Inspector.get_pk_constraint` method.",
)
def get_primary_keys(self, table_name, schema=None, **kw):
"""Return information about primary keys in `table_name`.