wiring.validation_results()
Validate a frame and yield the asset’s materialization and check results.
Usage
wiring.validation_results(
schema,
frame,
*,
valid_key,
quarantine_writer=None,
check_granularity=None,
schema_rules=None,
max_failure_samples=None,
statistics=None,
row_sample=None
)Parameters
frame: pl.DataFrame | pl.LazyFrame | None-
The frame to validate, or
Noneto skip. valid_key: dg.AssetKey-
The key the run materializes the valid rows under: the asset’s own key, such as
context.asset_key. A key the asset does not have fails the step withDagsterInvariantViolationErroron the first yield, and the asset writes nothing. quarantine_writer: QuarantineWriter | None = None-
The writer for the invalid rows, called at most once, with the frame quarantine_frame returns. With
None, any invalid row fails the run with ValidationAbortError, and the asset writes nothing. check_granularity: Granularity | None = None-
Pass the value check_specs received, or the results name checks the asset does not declare.
NoneusesDAGSTER_DATAFRAMELY_CHECK_GRANULARITYif set, elserule. schema_rules: SchemaRules | None = None-
Pass the value check_specs received, as for
check_granularity.NoneusesDAGSTER_DATAFRAMELY_SCHEMA_RULESif set, elsecollapsed. max_failure_samples: int | None = None-
A rule’s check metadata has at most this many rows that failed it.
NoneusesDAGSTER_DATAFRAMELY_MAX_FAILURE_SAMPLESif set, else5. statistics: bool | None = None-
Whether the materialization metadata has statistics of the written rows.
NoneusesDAGSTER_DATAFRAMELY_STATISTICSif set, elseTrue. row_sample: int | None = None-
The materialization metadata has at most this many valid rows, and this many invalid rows.
NoneusesDAGSTER_DATAFRAMELY_ROW_SAMPLEif set, else5.
Yields
The asset’sdg.MaterializeResult, if the run writes its table, then onedg.AssetCheckResultper check. On a skip, it yields only the check results, and every check passes. It writes the quarantine instead of yielding it.
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.
InvalidSettingError-
A setting’s argument or environment variable has a value the setting does not allow.
DagsterInvariantViolationError-
frameis neither a Polars frame norNone. ColumnSchemaError-
The frame’s columns or dtypes do not match the schema. It yields the column-schema check’s failing result first, and writes nothing.
ValidationAbortError-
Rows failed validation and
quarantine_writerisNone, so the package writes nothing. NoValidRowsError- Every row failed validation. It writes the quarantine, and not the asset’s table.