TECHNOLOGY

Dagster single-run backfills require range-aware asset code

In this article
THE QUICK TAKE

Change the asset’s input and write boundaries together with its backfill policy; one execution must still produce the complete selected partition coverage.

Distinguish orchestration grouping from data coverage

A document-processing asset can rebuild historical partitions with separate executions or submit a range to an external batch engine. Dagster’s backfill guide supports a single run covering selected partitions. Grouping reduces orchestration overhead in suitable systems, but it does not automatically rewrite asset code that previously handled one partition at a time. The requested historical coverage remains the same obligation.

Select the policy through the supported interface

The partitions reference defines BackfillPolicy.single_run() and the multi-run policy’s grouping control. The guide also requires compatible policy use when selecting assets in an asset job. Do not infer current controls from an old interface screenshot: the guide explicitly notes that its former single-versus-multiple-run toggle was removed. Treat the policy in code and the actual selected assets as the execution contract.

Read the range from execution context

The execution reference provides a partition-key list, key range and time window. Choose the representation appropriate for the storage query. Code using only partition_key must be adapted for the grouped execution. A time-window property also has requirements on the partition definition; a static category collection should not be treated as though it inherently supplies a contiguous interval of timestamps.

Write the same coverage that was read

If a batch query reads a selected interval, its output operation must replace or create the corresponding intended slices. Avoid writing every result to a path derived from an obsolete single-key assumption. Define boundaries consistently, including how storage handles the end of a time window. Task contracts should identify the complete rebuilt partition set, rather than accepting a successful external query as proof that every historical output was updated.

Inspect partial failures at the data boundary

A grouped execution can fail after an external engine has written some output. Record the selected range and actual storage outcome so a subsequent attempt can reconcile it. Tool observations preserve those facts. Backfill grouping changes the unit Dagster schedules; it does not make every remote write atomic. A useful completion review compares intended partition coverage with readable outputs and leaves incomplete slices visible instead of relying solely on the number of orchestration runs that finished.

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles