TECHNOLOGY

A Dagster asset sensor receives the latest materialization

In this article
THE QUICK TAKE

Use the built-in asset sensor for latest-materialization reactions when appropriate; an event-by-event requirement needs explicit event enumeration and progress accounting.

Define whether the latest state is sufficient

An analysis asset materializes repeatedly while a downstream reporting sensor is waiting for its next evaluation. If the report only needs the newest available analysis, reacting once can be appropriate. If every analysis revision needs independent archiving, the requirement is different. Dagster’s sensor API explicitly says an asset sensor is invoked once with the latest materialization when several occur between evaluations.

Read the event selection rather than infer a queue

The asset sensor implementation fetches materializations after its cursor in descending order, selecting the latest record. The cursor then advances to that event’s storage identifier. Intermediate materializations are not delivered as a series of callback invocations by this built-in mechanism. Increasing activity upstream does not convert its latest-event selection into a durable per-event consumption queue.

Bind the decision to the supplied materialization

The asset sensor guide demonstrates decisions based on materialization metadata and custom configuration passed to a triggered job. Carry the selected revision identity when the downstream report must describe that specific analysis. Merely reading whatever occupies the source path later can yield a different revision if another materialization occurs before the report executes. Specify whether the consumer follows a selected snapshot or intentionally reads current state.

Make event-complete processing a separate design

When every intermediate revision matters, use an explicit event-enumeration and progress scheme suitable for that requirement. Define how selected event identifiers become pending work and how completed work is recorded. A shorter polling interval can reduce coalescing opportunities but does not establish an event-delivery guarantee. Task contracts should say whether acceptance requires the latest report or an archive covering every materialization.

Investigate a missing revision with the right expectation

Compare the upstream event history with sensor evaluation times and the particular event supplied to the callback. Tool observations preserve those boundaries. An intermediate revision absent from downstream runs can follow the documented latest-event behavior without a failed callback. This distinction directs the remedy toward the consumption design when complete revision coverage is required, instead of repeatedly retrying a sensor that already processed its selected event correctly.

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