Exemple #1
0
def test_from_arrow():
    tbl = pa.table({
        "a": pa.array([1, 2], pa.timestamp("s")),
        "b": pa.array([1, 2], pa.timestamp("ms")),
        "c": pa.array([1, 2], pa.timestamp("us")),
        "d": pa.array([1, 2], pa.timestamp("ns")),
        "decimal1": pa.array([1, 2], pa.decimal128(2, 2)),
    })
    assert pl.from_arrow_table(tbl).shape == (2, 5)
Exemple #2
0
def test_from_arrow_table():
    data = {"a": [1, 2], "b": [1, 2]}
    tbl = pa.table(data)

    df = pl.from_arrow_table(tbl)
    df.frame_equal(pl.DataFrame(data))