def serialize_query_with_map_builtin_function(test, serial, fcn):
 t = symbol('t', discover(iris))
 expr = t.species.map(fcn, 'int')
 query = {'expr': to_tree(expr)}
 response = test.post('/compute', data=serial.dumps(query), headers=mimetype(serial))
 assert ('OK' in response.status)
 respdata = serial.loads(response.data)
 result = serial.data_loads(respdata['data'])
 exp_res = compute(expr, {t: iris}, return_type=list)
 return (exp_res, result)

def serialize_query_with_map_builtin_function ( test , serial , fcn ) : t = symbol ( 't' , discover ( iris ) ) expr = t . species . map ( fcn , 'int' ) query = { 'expr' : to_tree ( expr ) } response = test . post ( '/compute' , data = serial . dumps ( query ) , headers = mimetype ( serial ) ) assert ( 'OK' in response . status ) respdata = serial . loads ( response . data ) result = serial . data_loads ( respdata [ 'data' ] ) exp_res = compute ( expr , { t : iris } , return_type = list ) return ( exp_res , result )
serialize a query that invokes the map operation using a builtin function return the result of the post operation along with expected result .