MCPcopy Create free account
hub / github.com/zzzeek/sqlalchemy / test_deduping_unique_across_selects

Method test_deduping_unique_across_selects

test/sql/test_compiler.py:2754–2775  ·  view source on GitHub ↗

related to #7153 looking to see that dedupe anon labels use a unique hash not only within each statement but across multiple statements.

(self)

Source from the content-addressed store, hash-verified

2752 )
2753
2754 def test_deduping_unique_across_selects(self):
2755 """related to #7153
2756
2757 looking to see that dedupe anon labels use a unique hash not only
2758 within each statement but across multiple statements.
2759
2760 """
2761
2762 s1 = select(null(), null())
2763
2764 s2 = select(true(), true())
2765
2766 s3 = union(s1, s2)
2767
2768 self.assert_compile(
2769 s3,
2770 "SELECT NULL AS anon_1, NULL AS anon__1 UNION "
2771 # without the feature tested in test_deduping_hash_algo we'd get
2772 # "SELECT true AS anon_2, true AS anon__1",
2773 "SELECT true AS anon_2, true AS anon__2",
2774 dialect="default_enhanced",
2775 )
2776
2777 def test_compound_grouping(self):
2778 s = select(column("foo"), column("bar")).select_from(text("bat"))

Callers

nothing calls this directly

Calls 5

selectFunction · 0.90
nullFunction · 0.90
trueFunction · 0.90
unionFunction · 0.90
assert_compileMethod · 0.80

Tested by

no test coverage detected