from hypothesis import given
import polars as pl
from polars.testing.parametric import dataframes
@given(lf=dataframes(lazy=True))
def test_collect_schema_parametric(lf: pl.LazyFrame) -> None:
assert lf.collect_schema() == lf.collect().schema
def test_collect_schema() -> None:
lf = pl.LazyFrame(
{
"foo": [1, 2, 3],
"bar": [6.0, 7.0, 8.0],
"ham": ["a", "b", "c"],
}
)
result = lf.collect_schema()
expected = pl.Schema({"foo": pl.Int64(), "bar": pl.Float64(), "ham": pl.String()})
assert result == expected