Return a writer that passes the error rows to the asset’s own IO manager, or to the one error_rows_io_manager_key names.
wiring.build_io_manager_writer(
context, error_rows_key, *, error_rows_io_manager_key=None
)
The manager stores the rows under the error-rows key, as it stores any other asset: dd.data.ParquetIOManager writes a Parquet file beside the table, and DuckDBPolarsIOManager writes a table beside it. After each write, the writer logs a materialization for the error-rows key, so the spec from build_error_rows_spec has a history. It logs one for the empty write of a clean run too, so the history matches the stored rows. It logs none when the run’s code location has no spec for the key, so the catalog does not list a key that nobody declared.
Parameters
context: dg.AssetExecutionContext
-
The running asset’s context. Its asset definition must have exactly one asset, as a @dg.asset does.
error_rows_key: dg.AssetKey
-
The key the IO manager stores the rows under, such as the one get_error_rows_key returns.
error_rows_io_manager_key: str | None = None
-
The resource key of another IO manager, or
None for the asset’s own. The op must require this resource key, because context.resources holds only the resources its op requires. The writer passes that IO manager its own config, because a DbIOManager reads its connection from the context. It passes the asset’s definition metadata unchanged.
Returns
ErrorRowsWriter
-
A writer that takes the error rows and returns their asset key as a string.
Raises
dagster._core.errors.DagsterInvalidPropertyError
-
There is no step, which means a direct invocation. Use build_file_writer there.
Examples
A hand-wired asset with filter=True builds the writer from its context and passes it to stream_results:
from collections.abc import Iterator
import dagster as dg
import polars as pl
import dagster_dataframely as dd
from dagster_dataframely.data import OrdersSchema, marketplace_orders
@dg.asset(
metadata=dd.wiring.get_column_schema_metadata(OrdersSchema),
check_specs=dd.wiring.build_asset_check_specs(
OrdersSchema, asset="orders", filter=True
),
)
def orders(
context: dg.AssetExecutionContext,
) -> Iterator[dg.MaterializeResult[pl.DataFrame] | dg.AssetCheckResult]:
yield from dd.wiring.stream_results(
OrdersSchema,
marketplace_orders,
context=context,
error_rows_writer=dd.wiring.build_io_manager_writer(
context, dd.wiring.get_error_rows_key(context.asset_key)
),
)
dg.materialize([orders]).success
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - RUN_START - Started execution of run for "__ephemeral_asset_job__".
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - ENGINE_EVENT - Executing steps in process (pid: 3318)
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - RESOURCE_INIT_STARTED - Starting initialization of resources [io_manager].
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - RESOURCE_INIT_SUCCESS - Finished initialization of resources [io_manager].
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - LOGS_CAPTURED - Capturing logs for process (pid: 3318).
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - STEP_START - Started execution of step "orders".
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - orders - Writing file at: /tmp/tmpzfjqcg6t/storage/orders__error_rows using PickledObjectFilesystemIOManager...
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - ASSET_MATERIALIZATION - Materialized value orders__error_rows.
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - STEP_OUTPUT - Yielded output "result" of type "Any". (Type check passed).
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - orders - Writing file at: /tmp/tmpzfjqcg6t/storage/orders using PickledObjectFilesystemIOManager...
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - ASSET_MATERIALIZATION - Materialized value orders.
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - HANDLED_OUTPUT - Handled output "result" using IO manager "io_manager"
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - STEP_OUTPUT - Yielded output "orders_dy_schema__columns" of type "Any". (Type check passed).
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - ASSET_CHECK_EVALUATION - Asset check 'dy_schema__columns' on 'orders' passed. Description: 'Every column matches.'
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - STEP_OUTPUT - Yielded output "orders_dy_rule__paid_orders_have_amount" of type "Any". (Type check passed).
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - ASSET_CHECK_EVALUATION - Asset check 'dy_rule__paid_orders_have_amount' on 'orders' did not pass. Description: '1 row failed.'
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - STEP_OUTPUT - Yielded output "orders_dy_rule__line_numbers_are_dense" of type "Any". (Type check passed).
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - ASSET_CHECK_EVALUATION - Asset check 'dy_rule__line_numbers_are_dense' on 'orders' did not pass. Description: '2 rows failed.'
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - STEP_OUTPUT - Yielded output "orders_dy_rule__primary_key" of type "Any". (Type check passed).
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - ASSET_CHECK_EVALUATION - Asset check 'dy_rule__primary_key' on 'orders' passed. Description: 'No row failed.'
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - STEP_OUTPUT - Yielded output "orders_dy_rule__order_id__nullability" of type "Any". (Type check passed).
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - ASSET_CHECK_EVALUATION - Asset check 'dy_rule__order_id__nullability' on 'orders' passed. Description: 'No row failed.'
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - STEP_OUTPUT - Yielded output "orders_dy_rule__order_id__regex" of type "Any". (Type check passed).
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - ASSET_CHECK_EVALUATION - Asset check 'dy_rule__order_id__regex' on 'orders' did not pass. Description: '1 row failed.'
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - STEP_OUTPUT - Yielded output "orders_dy_rule__line_no__nullability" of type "Any". (Type check passed).
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - ASSET_CHECK_EVALUATION - Asset check 'dy_rule__line_no__nullability' on 'orders' passed. Description: 'No row failed.'
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - STEP_OUTPUT - Yielded output "orders_dy_rule__line_no__min" of type "Any". (Type check passed).
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - ASSET_CHECK_EVALUATION - Asset check 'dy_rule__line_no__min' on 'orders' passed. Description: 'No row failed.'
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - STEP_OUTPUT - Yielded output "orders_dy_rule__email__nullability" of type "Any". (Type check passed).
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - ASSET_CHECK_EVALUATION - Asset check 'dy_rule__email__nullability' on 'orders' passed. Description: 'No row failed.'
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - STEP_OUTPUT - Yielded output "orders_dy_rule__email__check__lowercase" of type "Any". (Type check passed).
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - ASSET_CHECK_EVALUATION - Asset check 'dy_rule__email__check__lowercase' on 'orders' did not pass. Description: '2 rows failed.'
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - STEP_OUTPUT - Yielded output "orders_dy_rule__email__max_length" of type "Any". (Type check passed).
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - ASSET_CHECK_EVALUATION - Asset check 'dy_rule__email__max_length' on 'orders' passed. Description: 'No row failed.'
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - STEP_OUTPUT - Yielded output "orders_dy_rule__amount__nullability" of type "Any". (Type check passed).
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - ASSET_CHECK_EVALUATION - Asset check 'dy_rule__amount__nullability' on 'orders' passed. Description: 'No row failed.'
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - STEP_OUTPUT - Yielded output "orders_dy_rule__amount__min" of type "Any". (Type check passed).
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - ASSET_CHECK_EVALUATION - Asset check 'dy_rule__amount__min' on 'orders' did not pass. Description: '2 rows failed.'
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - STEP_OUTPUT - Yielded output "orders_dy_rule__quantity__nullability" of type "Any". (Type check passed).
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - ASSET_CHECK_EVALUATION - Asset check 'dy_rule__quantity__nullability' on 'orders' passed. Description: 'No row failed.'
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - STEP_OUTPUT - Yielded output "orders_dy_rule__quantity__min" of type "Any". (Type check passed).
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - ASSET_CHECK_EVALUATION - Asset check 'dy_rule__quantity__min' on 'orders' passed. Description: 'No row failed.'
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - STEP_OUTPUT - Yielded output "orders_dy_rule__quantity__max" of type "Any". (Type check passed).
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - ASSET_CHECK_EVALUATION - Asset check 'dy_rule__quantity__max' on 'orders' did not pass. Description: '1 row failed.'
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - STEP_OUTPUT - Yielded output "orders_dy_rule__priority__is_in" of type "Any". (Type check passed).
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - ASSET_CHECK_EVALUATION - Asset check 'dy_rule__priority__is_in' on 'orders' did not pass. Description: '1 row failed.'
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - STEP_OUTPUT - Yielded output "orders_dy_rule__status__nullability" of type "Any". (Type check passed).
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - ASSET_CHECK_EVALUATION - Asset check 'dy_rule__status__nullability' on 'orders' passed. Description: 'No row failed.'
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - STEP_OUTPUT - Yielded output "orders_dy_rule__tracking_id__unique" of type "Any". (Type check passed).
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - ASSET_CHECK_EVALUATION - Asset check 'dy_rule__tracking_id__unique' on 'orders' passed. Description: 'No row failed.'
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - STEP_OUTPUT - Yielded output "orders_dy_rule__is_gift__nullability" of type "Any". (Type check passed).
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - ASSET_CHECK_EVALUATION - Asset check 'dy_rule__is_gift__nullability' on 'orders' passed. Description: 'No row failed.'
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - STEP_OUTPUT - Yielded output "orders_dy_rule__ordered_at__nullability" of type "Any". (Type check passed).
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - ASSET_CHECK_EVALUATION - Asset check 'dy_rule__ordered_at__nullability' on 'orders' passed. Description: 'No row failed.'
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - STEP_OUTPUT - Yielded output "orders_dy_rule__tags__max_length" of type "Any". (Type check passed).
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - ASSET_CHECK_EVALUATION - Asset check 'dy_rule__tags__max_length' on 'orders' passed. Description: 'No row failed.'
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - STEP_OUTPUT - Yielded output "orders_dy_rule__tags__inner_nullability" of type "Any". (Type check passed).
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - ASSET_CHECK_EVALUATION - Asset check 'dy_rule__tags__inner_nullability' on 'orders' passed. Description: 'No row failed.'
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - STEP_OUTPUT - Yielded output "orders_dy_rule__note__check" of type "Any". (Type check passed).
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - ASSET_CHECK_EVALUATION - Asset check 'dy_rule__note__check' on 'orders' passed. Description: 'No row failed.'
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - orders - STEP_SUCCESS - Finished execution of step "orders" in 161ms.
/home/runner/work/dagster-dataframely/dagster-dataframely/.venv/lib/python3.12/site-packages/dagster/_core/execution/context_creation_job.py:273: RuntimeWarning: coroutine 'BaseEventLoop.shutdown_asyncgens' was never awaited
pass
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - ENGINE_EVENT - Finished steps in process (pid: 3318) in 172ms
2026-10-22 02:10:34 +0000 - dagster - DEBUG - __ephemeral_asset_job__ - 594ab1c9-2379-4ad9-84aa-8a296986e281 - 3318 - RUN_SUCCESS - Finished execution of run for "__ephemeral_asset_job__".