コード例 #1
0
ファイル: udf.py プロジェクト: resurgo-genetics/ibis
def add_operation(op, func_name, db):
    """
    Registers the given operation within the Ibis SQL translation toolchain

    Parameters
    ----------
    op: operator class
    name: used in issuing statements to SQL engine
    database: database the relevant operator is registered to
    """
    full_name = '{0}.{1}'.format(db, func_name)
    if isinstance(op.input_type, rules.VarArgs):
        translator = comp.varargs(full_name)
    else:
        arity = len(op.input_type.types)
        translator = comp.fixed_arity(full_name, arity)

    comp._operation_registry[op] = translator
コード例 #2
0
ファイル: udf.py プロジェクト: BabelTower/ibis
def add_operation(op, func_name, db):
    """
    Registers the given operation within the Ibis SQL translation toolchain

    Parameters
    ----------
    op: operator class
    name: used in issuing statements to SQL engine
    database: database the relevant operator is registered to
    """
    full_name = '{0}.{1}'.format(db, func_name)
    if isinstance(op.input_type, rules.VarArgs):
        translator = comp.varargs(full_name)
    else:
        arity = len(op.input_type.types)
        translator = comp.fixed_arity(full_name, arity)

    comp._operation_registry[op] = translator