JakobGM / patito

A data modelling layer built on top of polars and pydantic
MIT License
307 stars 24 forks source link

Cuallee features #96

Open butterlyn opened 2 months ago

butterlyn commented 2 months ago

Hi,

Was wondering if it's worth looking through the Polars checks implemented in the Python library cuallee to see if they're worth including in Field?

lmmx commented 1 month ago

Links: (cuallee / docs)

Is there anything in particular you had in mind from it for Patito? At a glance it looks like:

I also see it supports Polars

Can you share any more about your experience using it with Polars?

canimus commented 1 month ago

Hi, maintainer of cuallee here. Even when the documentation is mostly up to date with the Check interface of cuallee, the Control interface lacks some love. In any case, just wanted to say is that it does support polars for example:

import polars as pl
from cuallee import Control
df = pl.DataFrame({"A":[1,2,3,4,5]})
Control.completeness(df)
# ========================================
shape: (1, 12)
┌─────┬───────────┬───────────┬─────────┬────────┬───────────┬───────┬──────┬───────────┬──────────┬──────────┬────────┐
│ id  ┆ timestamp ┆ check     ┆ level   ┆ column ┆ rule      ┆ value ┆ rows ┆ violation ┆ pass_rat ┆ pass_thr ┆ status │
│ --- ┆ ---       ┆ ---       ┆ ---     ┆ ---    ┆ ---       ┆ ---   ┆ ---  ┆ s         ┆ e        ┆ eshold   ┆ ---    │
│ i64 ┆ str       ┆ str       ┆ str     ┆ str    ┆ str       ┆ str   ┆ i64  ┆ ---       ┆ ---      ┆ ---      ┆ str    │
│     ┆           ┆           ┆         ┆        ┆           ┆       ┆      ┆ i64       ┆ f64      ┆ f64      ┆        │
╞═════╪═══════════╪═══════════╪═════════╪════════╪═══════════╪═══════╪══════╪═══════════╪══════════╪══════════╪════════╡
│ 1   ┆ 2024-09-2 ┆ Completen ┆ WARNING ┆ A      ┆ is_comple ┆ N/A   ┆ 5    ┆ 0         ┆ 1.0      ┆ 1.0      ┆ PASS   │
│     ┆ 8         ┆ ess       ┆         ┆        ┆ te        ┆       ┆      ┆           ┆          ┆          ┆        │
│     ┆ 08:27:32  ┆           ┆         ┆        ┆           ┆       ┆      ┆           ┆          ┆          ┆        │
└─────┴───────────┴───────────┴─────────┴────────┴───────────┴───────┴──────┴───────────┴──────────┴──────────┴────────┘