diff options
author | Gord Thompson <gord@gordthompson.com> | 2021-12-20 14:37:13 -0700 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-12-27 14:32:39 -0500 |
commit | 5ada58954afa4fa427f4f7a91c683c1210d3d6df (patch) | |
tree | 983a285274d93bb94d3687fdb502d52470f9197d /test/dialect/postgresql/test_reflection.py | |
parent | 2bb6cfc7c9b8f09eaa4efeffc337a1162993979c (diff) | |
download | sqlalchemy-5ada58954afa4fa427f4f7a91c683c1210d3d6df.tar.gz |
Reflect included columns as dialect_options
Fixed reflection of covering indexes to report ``include_columns`` as part
of the ``dialect_options`` entry in the reflected index dictionary, thereby
enabling round trips from reflection->create to be complete. Included
columns continue to also be present under the ``include_columns`` key for
backwards compatibility.
Fixes: #7382
Change-Id: I4f16b65caed3a36d405481690a3a92432b5efd62
Diffstat (limited to 'test/dialect/postgresql/test_reflection.py')
-rw-r--r-- | test/dialect/postgresql/test_reflection.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/dialect/postgresql/test_reflection.py b/test/dialect/postgresql/test_reflection.py index 2bfce557f..0e8a18c0f 100644 --- a/test/dialect/postgresql/test_reflection.py +++ b/test/dialect/postgresql/test_reflection.py @@ -183,6 +183,7 @@ class PartitionedReflectionTest(fixtures.TablesTest, AssertsExecutionResults): "unique": False, "column_names": ["q"], "include_columns": [], + "dialect_options": {"postgresql_include": []}, } ], ) @@ -198,6 +199,7 @@ class PartitionedReflectionTest(fixtures.TablesTest, AssertsExecutionResults): { "column_names": ["q"], "include_columns": [], + "dialect_options": {"postgresql_include": []}, "name": mock.ANY, "unique": False, } @@ -1131,6 +1133,7 @@ class ReflectionTest( expected = [{"name": "idx1", "unique": False, "column_names": ["y"]}] if testing.requires.index_reflects_included_columns.enabled: expected[0]["include_columns"] = [] + expected[0]["dialect_options"] = {"postgresql_include": []} eq_(ind, expected) @@ -1163,6 +1166,7 @@ class ReflectionTest( ] if testing.requires.index_reflects_included_columns.enabled: expected[0]["include_columns"] = [] + expected[0]["dialect_options"]["postgresql_include"] = [] eq_(ind, expected) m = MetaData() @@ -1195,6 +1199,7 @@ class ReflectionTest( ] if testing.requires.index_reflects_included_columns.enabled: expected[0]["include_columns"] = [] + expected[0]["dialect_options"]["postgresql_include"] = [] eq_(ind, expected) m = MetaData() t1 = Table("t", m, autoload_with=connection) @@ -1229,6 +1234,7 @@ class ReflectionTest( "unique": False, "column_names": ["x"], "include_columns": ["name"], + "dialect_options": {"postgresql_include": ["name"]}, "name": "idx1", } ], @@ -1604,6 +1610,7 @@ class ReflectionTest( ] if testing.requires.index_reflects_included_columns.enabled: expected[0]["include_columns"] = [] + expected[0]["dialect_options"]["postgresql_include"] = [] eq_(insp.get_indexes("t"), expected) |