#NEWLINE# def test_agg_sql( db , data ) : #NEWLINE# #INDENT# subset = db . nyc [ [ 'pickup_datetime' , 'dropoff_datetime' , 'passenger_count' ] ] #NEWLINE# expr = subset [ ( subset . passenger_count < 4 ) ] . passenger_count . min ( ) #NEWLINE# result = compute ( db , data , return_type = 'native' ) #NEWLINE# expected = '\n    select\n        min(alias.passenger_count) as passenger_count_min\n    from\n        (select\n            nyc.passenger_count as passenger_count\n         from\n            nyc\n         where nyc.passenger_count < %s) as alias\n    ' #NEWLINE# assert ( normalize ( str ( result ) ) == normalize ( expected ) )