A light-weight, flexible, and expressive statistical data testing library
Full Changelog: https://github.com/unionai-oss/pandera/compare/v0.19.2...v0.19.3
Full Changelog: https://github.com/unionai-oss/pandera/compare/v0.19.1...v0.19.2
Full Changelog: https://github.com/unionai-oss/pandera/compare/v0.19.0...v0.19.1
📣 Pandera now supports validation of polars.DataFrame
and polars.LazyFrame
🐻❄️!
You can now do this:
import pandera.polars as pa
import polars as pl
class Schema(pa.DataFrameModel):
state: str
city: str
price: int = pa.Field(in_range={"min_value": 5, "max_value": 20})
lf = pl.LazyFrame(
{
'state': ['FL','FL','FL','CA','CA','CA'],
'city': [
'Orlando',
'Miami',
'Tampa',
'San Francisco',
'Los Angeles',
'San Diego',
],
'price': [8, 12, 10, 16, 20, 18],
}
)
Schema.validate(lf).collect()
And of course you can do functional validation with decorators like so:
from pandera.typing.polars import LazyFrame
@pa.check_types
def function(lf: LazyFrame[Schema]) -> LazyFrame[Schema]:
return lf.filter(pl.col("state").eq("CA"))
function(lf).collect()
You can read more about the integration here. Not all pandera features are supported at this point, but depending on community demand/contributions we'll slowly add them. To learn more about what's currently supported, check out this table.
Special shoutout to @AndriiG13 and @FilipAisot for their contributions on the built-in checks and polars datatypes, respectively, and to @evanrasmussen9, @baldwinj30, @obiii, @Filimoa, @philiporlando, @r-bar, @alkment, @jjfantini, and @robertdj for their early feedback and bug reports during the 0.19.0 beta.
check_nullable
does not uselessly compute isna()
anymore in pandas backend by @smarie in https://github.com/unionai-oss/pandera/pull/1538
Full Changelog: https://github.com/unionai-oss/pandera/compare/v0.18.3...v0.19.0
Full Changelog: https://github.com/unionai-oss/pandera/compare/v0.19.0b3...v0.19.0b4
Full Changelog: https://github.com/unionai-oss/pandera/compare/v0.19.0b2...v0.19.0b3
Full Changelog: https://github.com/unionai-oss/pandera/compare/v0.19.0b1...v0.19.0b2
check_nullable
does not uselessly compute isna()
anymore in pandas backend by @smarie in https://github.com/unionai-oss/pandera/pull/1538
Full Changelog: https://github.com/unionai-oss/pandera/compare/v0.18.3...v0.19.0b1
Full Changelog: https://github.com/unionai-oss/pandera/compare/v0.18.3...v0.19.0b0
Full Changelog: https://github.com/unionai-oss/pandera/compare/v0.18.2...v0.18.3