#NEWLINE# def test_filter_subquery_derived_reduction( self ) : #NEWLINE# #INDENT# ( expr3 , expr4 ) = self . _case_filter_subquery_derived_reduction ( ) #NEWLINE# result = to_sql ( expr3 ) #NEWLINE# expected = "SELECT *\nFROM star1\nWHERE `f` > (\n  SELECT ln(avg(`f`)) AS `tmp`\n  FROM star1\n  WHERE `foo_id` = 'foo'\n)" #NEWLINE# assert ( result == expected ) #NEWLINE# result = to_sql ( expr4 ) #NEWLINE# expected = "SELECT *\nFROM star1\nWHERE `f` > (\n  SELECT ln(avg(`f`)) + 1 AS `tmp`\n  FROM star1\n  WHERE `foo_id` = 'foo'\n)" #NEWLINE# assert ( result == expected )