pandera.backends.narwhals.checks.NarwhalsCheckBackendΒΆ
- class pandera.backends.narwhals.checks.NarwhalsCheckBackend(check)[source]ΒΆ
Check backend for Narwhals.
Initializes a check backend object.
Methods
- postprocess(check_obj, check_output)[source]ΒΆ
Postprocesses the result of applying the check function.
- postprocess_bool_output(check_obj, check_output)[source]ΒΆ
Postprocesses bool check output into a CheckResult.
- Return type:
CheckResult
- postprocess_expr_output(check_obj, expr)[source]ΒΆ
Postprocesses nw.Expr check output into a CheckResult.
Stores the original expr as check_output and defers failure_cases computation entirely β no wide table is built during the check loop.
When drop_invalid_rows=True: failure_cases are never needed, so this avoids all per-check materialization. When SchemaErrors is raised: failure_cases_metadata() in base.py reconstructs them from the stored expr exactly once.
check_passed is computed via a single-column select+aggregate (frame.select(expr) β apply ignore_na on column β .select(.all())) rather than frame.with_columns(expr) which keeps all original columns.
ignore_na is applied at the column level AFTER evaluation rather than as expr | expr.is_null() β the latter causes ibis to produce incorrect SQL (isnull() on an expression before binding returns True for all rows on some SQL backends, because the expression is treated as nullable).
- Return type:
CheckResult
- postprocess_lazyframe_output(check_obj, check_output)[source]ΒΆ
Postprocesses LazyFrame check output into a CheckResult.
- Return type:
CheckResult