Skip to content

Polars

filebadge

exportbadge

Introduced in v4.0

The Polars backend is experimental and is subject to backwards incompatible changes.

Install

Install ibis and dependencies for the Polars backend:

pip install 'ibis-framework[polars]'
conda install -c conda-forge ibis-polars
mamba install -c conda-forge ibis-polars

Connect

ibis.polars.connect

con = ibis.polars.connect()

ibis.polars.connect is a thin wrapper around ibis.backends.polars.Backend.do_connect.

Connection Parameters

do_connect(tables=None)

Construct a client from a dictionary of polars.LazyFrames.

Parameters:

Name Type Description Default
tables MutableMapping[str, pl.LazyFrame] | None

An optional mapping of string table names to polars LazyFrames.

None

File Support

read_csv(path, table_name=None, **kwargs)

Register a CSV file as a table in the current database.

Parameters:

Name Type Description Default
path str | Path

The data source. A string or Path to the CSV file.

required
table_name str | None

An optional name to use for the created table. This defaults to a sequentially generated name.

None
**kwargs Any

Additional keyword arguments passed to Polars loading function. See https://pola-rs.github.io/polars/py-polars/html/reference/api/polars.scan_csv.html for more information.

{}

read_parquet(path, table_name=None, **kwargs)

Register a parquet file as a table in the current database.

Parameters:

Name Type Description Default
path str | Path

The data source(s). May be a path to a file or directory of parquet files.

required
table_name str | None

An optional name to use for the created table. This defaults to a sequentially generated name.

None
**kwargs Any

Additional keyword arguments passed to Polars loading function. See https://pola-rs.github.io/polars/py-polars/html/reference/api/polars.scan_parquet.html for more information.

{}

Last update: May 30, 2023