def METHOD_NAME(t, op):
    arg, where = op.args
    if arg.dtype.is_boolean():
        if isinstance(arg, ops.TableColumn):
            nullable = arg.dtype.nullable
            arg = ops.Cast(arg, dt.dtype(cast_type)(nullable=nullable))
        else:
            arg = ops.Where(arg, 1, 0)
    if where is not None:
        arg = ops.Where(where, arg, None)
    return func(t.translate(arg))