<s> from agate . aggregations . base import Aggregation <EOL> from agate . data_types import Date , DateTime , Number <EOL> from agate . exceptions import DataTypeError <EOL> class Min ( Aggregation ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , column_name ) : <EOL> self . _column_name = column_name <EOL> def get_aggregate_data_type ( self , table ) : <EOL> column = table . columns [ self . _column_name ] <EOL> if ( isinstance ( column . data_type , Number ) or <EOL> isinstance ( column . data_type , Date ) or <EOL> isinstance ( column . data_type , DateTime ) ) : <EOL> return column . data_type <EOL> def validate ( self , table ) : <EOL> column = table . columns [ self . _column_name ] <EOL> if not ( isinstance ( column . data_type , Number ) or <EOL> isinstance ( column . data_type , Date ) or <EOL> isinstance ( column . data_type , DateTime ) ) : <EOL> raise DataTypeError ( '<STR_LIT>' ) <EOL> def run ( self , table ) : <EOL> column = table . columns [ self . _column_name ] <EOL> return min ( column . values_without_nulls ( ) ) </s>
