Skip to content

v0.32.0

Latest

Choose a tag to compare

@cosmicBboy cosmicBboy released this 19 Jun 00:58
cf13ee4

⭐️ Highlights: Add support for narwhals backend

In this release, we're adding support for a narwhals backend that supports the polars, ibis and pyspark-sql schema APIs. To enable it, install the narwhals extra with the support framework of your choice:

pip install 'pandera[narwhals,polars]'   # Polars
pip install 'pandera[narwhals,ibis]'     # Ibis
pip install 'pandera[narwhals,pyspark]'  # PySpark SQL

Then enable with an environment variable:

export PANDERA_USE_NARWHALS_BACKEND=True

Or configure programmatically:

import pandera.polars as pa 
# import pandera.pyspark as pa  # 👈 for pyspark schemas
# import pandera.ibis as pa  # 👈 for ibis schemas

# CONFIG.use_narwhals_backend is read here — not at import time above
pa.config.set_config(use_narwhals_backend=True)

schema = pa.DataFrameSchema({"name": pa.Column(str)})  # narwhals backends registered
schema.validate(df)

See the docs for more information.

What's Changed

New Contributors

Full Changelog: v0.31.1...v0.32.0