<s> from airflow . hooks import PrestoHook <EOL> from airflow . operators import CheckOperator , ValueCheckOperator , IntervalCheckOperator <EOL> from airflow . utils . decorators import apply_defaults <EOL> class PrestoCheckOperator ( CheckOperator ) : <EOL> """<STR_LIT>""" <EOL> @ apply_defaults <EOL> def __init__ ( <EOL> self , sql , <EOL> presto_conn_id = '<STR_LIT>' , <EOL> * args , ** kwargs ) : <EOL> super ( PrestoCheckOperator , self ) . __init__ ( sql = sql , * args , ** kwargs ) <EOL> self . presto_conn_id = presto_conn_id <EOL> self . sql = sql <EOL> def get_db_hook ( self ) : <EOL> return PrestoHook ( presto_conn_id = self . presto_conn_id ) <EOL> class PrestoValueCheckOperator ( ValueCheckOperator ) : <EOL> """<STR_LIT>""" <EOL> @ apply_defaults <EOL> def __init__ ( <EOL> self , sql , pass_value , tolerance = None , <EOL> presto_conn_id = '<STR_LIT>' , <EOL> * args , ** kwargs ) : <EOL> super ( PrestoValueCheckOperator , self ) . __init__ ( sql , pass_value , tolerance , * args , ** kwargs ) <EOL> self . presto_conn_id = presto_conn_id <EOL> def get_db_hook ( self ) : <EOL> return PrestoHook ( presto_conn_id = self . presto_conn_id ) <EOL> class PrestoIntervalCheckOperator ( IntervalCheckOperator ) : <EOL> """<STR_LIT>""" <EOL> @ apply_defaults <EOL> def __init__ ( <EOL> self , table , metrics_thresholds , <EOL> date_filter_column = '<STR_LIT>' , days_back = - <NUM_LIT:7> , <EOL> presto_conn_id = '<STR_LIT>' , <EOL> * args , ** kwargs ) : <EOL> super ( PrestoIntervalCheckOperator , self ) . __init__ ( <EOL> table , metrics_thresholds , date_filter_column , days_back , <EOL> * args , ** kwargs ) <EOL> self . presto_conn_id = presto_conn_id <EOL> def get_db_hook ( self ) : <EOL> return PrestoHook ( presto_conn_id = self . presto_conn_id ) </s>
