<s> from airflow . contrib . hooks . bigquery_hook import BigQueryHook <EOL> from airflow . operators import CheckOperator , ValueCheckOperator , IntervalCheckOperator <EOL> from airflow . utils . decorators import apply_defaults <EOL> class BigQueryCheckOperator ( CheckOperator ) : <EOL> """<STR_LIT>""" <EOL> @ apply_defaults <EOL> def __init__ ( <EOL> self , <EOL> sql , <EOL> bigquery_conn_id = '<STR_LIT>' , <EOL> * args , <EOL> ** kwargs ) : <EOL> super ( BigQueryCheckOperator , self ) . __init__ ( sql = sql , * args , ** kwargs ) <EOL> self . bigquery_conn_id = bigquery_conn_id <EOL> self . sql = sql <EOL> def get_db_hook ( self ) : <EOL> return BigQueryHook ( bigquery_conn_id = self . bigquery_conn_id ) <EOL> class BigQueryValueCheckOperator ( ValueCheckOperator ) : <EOL> """<STR_LIT>""" <EOL> @ apply_defaults <EOL> def __init__ ( <EOL> self , sql , pass_value , tolerance = None , <EOL> bigquery_conn_id = '<STR_LIT>' , <EOL> * args , ** kwargs ) : <EOL> super ( BigQueryValueCheckOperator , self ) . __init__ ( <EOL> sql = sql , pass_value = pass_value , tolerance = tolerance , <EOL> * args , ** kwargs ) <EOL> self . bigquery_conn_id = bigquery_conn_id <EOL> def get_db_hook ( self ) : <EOL> return BigQueryHook ( bigquery_conn_id = self . bigquery_conn_id ) <EOL> class BigQueryIntervalCheckOperator ( 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> bigquery_conn_id = '<STR_LIT>' , <EOL> * args , ** kwargs ) : <EOL> super ( BigQueryIntervalCheckOperator , self ) . __init__ ( <EOL> table = table , metrics_thresholds = metrics_thresholds , <EOL> date_filter_column = date_filter_column , days_back = days_back , <EOL> * args , ** kwargs ) <EOL> self . bigquery_conn_id = bigquery_conn_id <EOL> def get_db_hook ( self ) : <EOL> return BigQueryHook ( bigquery_conn_id = self . bigquery_conn_id ) </s>
