示例#1
0
def table(schema, name=None):
    """
    Create an unbound Ibis table for creating expressions. Cannot be executed
    without being bound to some physical table.

    Useful for testing

    Parameters
    ----------
    schema : ibis Schema
    name : string, default None
      Name for table

    Returns
    -------
    table : TableExpr
    """
    if not isinstance(schema, Schema):
        if isinstance(schema, list):
            schema = Schema.from_tuples(schema)
        else:
            schema = Schema.from_dict(schema)

    node = _ops.UnboundTable(schema, name=name)
    return TableExpr(node)
示例#2
0
文件: api.py 项目: zuxfoucault/ibis
def table(schema, name=None):
    """
    Create an unbound Ibis table for creating expressions. Cannot be executed
    without being bound to some physical table.

    Useful for testing

    Parameters
    ----------
    schema : ibis Schema
    name : string, default None
      Name for table

    Returns
    -------
    table : TableExpr
    """
    if not isinstance(schema, Schema):
        if isinstance(schema, list):
            schema = Schema.from_tuples(schema)
        else:
            schema = Schema.from_dict(schema)

    node = _ops.UnboundTable(schema, name=name)
    return TableExpr(node)
示例#3
0
 def _get_table_schema(self, name):
     name = name.replace('`', '')
     return Schema.from_tuples(self._tables[name])
示例#4
0
def schema(pairs=None, names=None, types=None):
    if pairs is not None:
        return Schema.from_tuples(pairs)
    else:
        return Schema(names, types)
示例#5
0
文件: api.py 项目: zuxfoucault/ibis
def schema(pairs=None, names=None, types=None):
    if pairs is not None:
        return Schema.from_tuples(pairs)
    else:
        return Schema(names, types)