

def _find_in_set(translator, expr):
    op = expr.op()
    (arg, str_list) = op.args
    arg_formatted = translator.translate(arg)
    str_formatted = ','.join([x._arg.value for x in str_list])
    return "find_in_set({0}, '{1}') - 1".format(arg_formatted, str_formatted)

dataset/ETHPy150Open cloudera/ibis/ibis/impala/compiler.py _find_in_set/original