#NEWLINE# def test_count_distinct( self ) : #NEWLINE# #INDENT# t = self . alltypes #NEWLINE# sat = self . sa_alltypes . alias ( 't0' ) #NEWLINE# cases = [ ( t . int_col . nunique ( ) . name ( 'nunique' ) , sa . select ( [ F . count ( sat . c . int_col . distinct ( ) ) . label ( 'nunique' ) ] ) ) , ( t . group_by ( 'string_col' ) . aggregate ( t . int_col . nunique ( ) . name ( 'nunique' ) ) , sa . select ( [ sat . c . string_col , F . count ( sat . c . int_col . distinct ( ) ) . label ( 'nunique' ) ] ) . group_by ( sat . c . string_col ) ) ] #NEWLINE# for ( case , ex ) in cases : #NEWLINE# #INDENT# self . _compare_sqla ( sat , ex )