diff options
Diffstat (limited to 'test/sql/test_from_linter.py')
| -rw-r--r-- | test/sql/test_from_linter.py | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/test/sql/test_from_linter.py b/test/sql/test_from_linter.py index 4a4d907f9..1fa3aff36 100644 --- a/test/sql/test_from_linter.py +++ b/test/sql/test_from_linter.py @@ -165,8 +165,15 @@ class TestFindUnmatchingFroms(fixtures.TablesTest): assert start is p3 assert froms == {p1} + @testing.combinations( + "render_derived", "alias", None, argnames="additional_transformation" + ) @testing.combinations(True, False, argnames="joins_implicitly") - def test_table_valued(self, joins_implicitly): + def test_table_valued( + self, + joins_implicitly, + additional_transformation, + ): """test #7845""" my_table = table( "tbl", @@ -175,9 +182,16 @@ class TestFindUnmatchingFroms(fixtures.TablesTest): ) sub_dict = my_table.c.data["d"] - tv = func.json_each(sub_dict).table_valued( - "key", joins_implicitly=joins_implicitly - ) + + tv = func.json_each(sub_dict) + + tv = tv.table_valued("key", joins_implicitly=joins_implicitly) + + if additional_transformation == "render_derived": + tv = tv.render_derived(name="tv", with_types=True) + elif additional_transformation == "alias": + tv = tv.alias() + has_key = tv.c.key == "f" stmt = select(my_table.c.id).where(has_key) froms, start = find_unmatching_froms(stmt, my_table) |
