Return the rows that failed an "error" rule, as a writer receives them, with one rule column per rule.
wiring.get_error_rows(
schema,
failure,
)
Parameters
schema: type[dy.Schema]
-
The schema the rows were validated against, which sets each rule’s severity.
failure: dy.FailureInfo
-
What
Schema.filter returned beside the valid rows.
Returns
pl.DataFrame
-
The original columns in their own order, then a
String rule column for every rule, named by get_check_name_for_rule. A rule column’s value is valid, invalid or unknown.
Raises
ReservedColumnError
-
A column name is in the reserved dy_ namespace.
InvalidColumnNameError
-
A column name has a character Dagster does not allow in an asset check name.
CheckNameCollisionError
-
Two rules produce the same asset check name.
InvalidSeverityError
-
The schema declares a severity this package cannot read.
Examples
import dagster_dataframely as dd
from dagster_dataframely.data import OrdersSchema, marketplace_orders
_, failure = OrdersSchema.filter(marketplace_orders, cast=False)
error_rows = dd.wiring.get_error_rows(OrdersSchema, failure)
error_rows.select("order_id", "amount", "dy_rule__amount__min")
shape: (8, 3)| order_id | amount | dy_rule__amount__min |
|---|
| str | decimal[10,2] | str |
| "ORD-0011" | -4.00 | "invalid" |
| "ORD-0012" | 22.00 | "valid" |
| "ORD-0013" | 60.00 | "valid" |
| "ORD-9" | 31.00 | "valid" |
| "ORD-0014" | 77.00 | "valid" |
| "ORD-0015" | -1.00 | "invalid" |
| "ORD-0016" | 14.00 | "valid" |
| "ORD-0016" | 16.00 | "valid" |