class MyOp(ops.ValueOp): input_type = [ rules.table(name='table', schema=rules.table.with_column_subset( rules.column(name='group', value_type=rules.number), rules.column(name='value', value_type=rules.number))) ] output_type = rules.type_of_arg(0)
class IfNull(ValueOp): """ Equivalent to (but perhaps implemented differently): case().when(expr.notnull(), expr) .else_(null_substitute_expr) """ input_type = [value, value(name='ifnull_expr')] output_type = rules.type_of_arg(0)
class WindowOp(ValueOp): output_type = rules.type_of_arg(0) def __init__(self, expr, window): if not is_analytic(expr): raise com.IbisInputError('Expression does not contain a valid ' 'window operation') ValueNode.__init__(self, expr, window) def over(self, window): existing_window = self.args[1] new_window = existing_window.combine(window) return WindowOp(self.args[0], new_window)
class NthValue(AnalyticOp): input_type = [rules.array, rules.integer] output_type = rules.type_of_arg(0)
class LastValue(AnalyticOp): input_type = [rules.array] output_type = rules.type_of_arg(0)
class Abs(UnaryOp): """ Absolute value """ output_type = rules.type_of_arg(0)
class ZeroIfNull(UnaryOp): output_type = rules.type_of_arg(0)
class Negate(UnaryOp): input_type = [number] output_type = rules.type_of_arg(0)
class MyOp(ops.ValueOp): input_type = [rules.table(name='table', validator=lambda x: 1 / 0)] output_type = rules.type_of_arg(0)
class MyOp(ops.ValueOp): input_type = [rules.table(name='table', schema='wrong class')] output_type = rules.type_of_arg(0)
class MyOp(ops.ValueOp): input_type = [rules.table(name='table')] output_type = rules.type_of_arg(0)
class MyOp(ops.ValueOp): input_type = [rules.array(dt.double, name='value')] output_type = rules.type_of_arg(0)