diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-05-07 17:13:35 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-05-07 19:56:32 -0400 |
commit | 8782469b789585d3f0c3a642f0bb9519816f6b11 (patch) | |
tree | 4d4c0e033cd235ec57935c6d037756d21f43ff8f /lib/sqlalchemy/testing/assertions.py | |
parent | 9821bddfcb3c94cea13b7f19bcb27845b0dc1ed8 (diff) | |
download | sqlalchemy-8782469b789585d3f0c3a642f0bb9519816f6b11.tar.gz |
Warn when sorted_tables is not actually sorting
A warning is emitted when making use of the :attr:`.MetaData.sorted_tables`
attribute as well as the :func:`_schema.sort_tables` function, and the
given tables cannot be correctly sorted due to a cyclic dependency between
foreign key constraints. In this case, the functions will no longer sort
the involved tables by foreign key, and a warning will be emitted. Other
tables that are not part of the cycle will still be returned in dependency
order. Previously, the sorted_table routines would return a collection that
would unconditionally omit all foreign keys when a cycle was detected, and
no warning was emitted.
Fixes: #5316
Change-Id: I14f72ccf39cb568bc77e8da16d0685718b2b9960
Diffstat (limited to 'lib/sqlalchemy/testing/assertions.py')
0 files changed, 0 insertions, 0 deletions