def check_sql_input(f):
 def new_f(widget, data, *args, **kwargs):
  widget.Error.add_message('download_sql_data', _download_sql_data)
  widget.Error.download_sql_data.clear()
  if isinstance(data, SqlTable):
   if (data.approx_len() < AUTO_DL_LIMIT):
    data = Table(data)
   else:
    widget.Error.download_sql_data()
    data = None
  return f(widget, data, *args, **kwargs)
 return new_f

def check_sql_input ( f ) : def new_f ( widget , data , * args , ** kwargs ) : widget . Error . add_message ( 'download_sql_data' , _download_sql_data ) widget . Error . download_sql_data . clear ( ) if isinstance ( data , SqlTable ) : if ( data . approx_len ( ) < AUTO_DL_LIMIT ) : data = Table ( data ) else : widget . Error . download_sql_data ( ) data = None return f ( widget , data , * args , ** kwargs ) return new_f
wrapper for widgets set_data method that first checks if the input is a sqltable and: - if small enough .