LazyBearFrameThe main object representing a lazy SQL query. It is immutable; every transformation returns a new LazyBearFrame.
columnslist[str]enginesqlalchemy.Engineselect(*items)items: Column names, tuples (alias, expr), or AliasedExpr.filter(predicate)predicate: An Expr or boolean condition.with_columns(*exprs, **named)exprs: Positional expressions.named: Keyword arguments for aliased expressions.sort(by, *more_by, descending=False)by: Column name or expression to sort by.descending: Boolean or sequence of booleans for sort direction.order_by(*keys)keys: Column names (prefix with - for descending) or expressions.limit(n)join(other, on=None, *, left_on=None, right_on=None, how='inner', suffixes=('_x', '_y'))LazyBearFrame.group_by(*keys)GroupedLazyBearFrame.GroupedLazyBearFrameA frame representing grouped data, returned by LazyBearFrame.group_by.
agg(**aggregations)aggregations: Keyword arguments where the key is the output column name and the value is a tuple (column, function).'count', 'sum', 'avg', 'mean', 'min', 'max'.lf.group_by('department').agg(
total_salary=('salary', 'sum'),
avg_age=(col('age'), 'mean'),
employee_count=('id', 'count')
)
collect(limit=None, infer_schema_length=200)polars.DataFrame.teradatasql string columns have trailing whitespace stripped to account for character datatype padding.to_arrow(limit=None)pyarrow.Table.collect_batches(chunk_size=10_000)polars.DataFrame chunks.teradatasql string columns have trailing whitespace stripped to account for character datatype padding.iter_rows(named=False, chunk_size=10_000)named=True).teradatasql string columns have trailing whitespace stripped to account for character datatype padding.explain()write_parquet(file, chunk_size=None, start_index=0, **kwargs)chunk_size is set, writes multiple files.write_csv(file, chunk_size=None, **kwargs)to_select()Select object.This has limited testing.
scan_table(table_name, engine, schema=None, lowercase=True)LazyBearFrame from a database table.True (default), column names are exposed as lowercase. This is useful for databases that return uppercase column names by default (e.g., Snowflake, Oracle, DB2) to keep code consistent with Polars. Set to False to preserve the exact casing from the database.scan_sql_query(query, engine, columns=None)LazyBearFrame from a raw SQL SELECT query.scan_df(df, engine, table_name=None)TempLazyBearFrame from a local polars.DataFrame.collect() or similar materialization methods are called. The table is automatically dropped after the result is fetched.