TECHNOLOGY

Dagster SensorResult registers dynamic partitions before run selection

In this article
THE QUICK TAKE

Treat dynamic partition registration as a change to the valid key set, then track each requested run and produced artifact separately.

Discover a key that did not exist at definition time

A new document collection arrives after the processing asset was defined. It should become an independently addressable partition without editing a fixed category list. Dagster’s partitioning guide uses DynamicPartitionsDefinition for keys discovered at runtime. The discovery process decides what constitutes a collection and supplies its key; the orchestrator does not infer that identity from arbitrary incoming files.

Register the key and request work explicitly

The guide demonstrates a SensorResult containing dynamic partition additions and corresponding run requests. These instructions are distinct. Adding a valid partition name does not itself execute its analysis, and requesting work should identify the intended partition. Keep the association explicit when a discovery pass finds several collections, so a registered but unprocessed collection can be distinguished from a collection that was never discovered.

Use the documented ordering inside SensorResult

The sensor API states that run requests are evaluated against partition state with the requested changes applied. This permits a sensor result to register newly discovered keys and target them in accompanying requests. It is an ordering rule for interpreting the result, not a claim that every requested run has already executed successfully or that all external writes belonging to those runs are atomic.

Keep the dynamic registry in the right instance

The partitions reference describes named dynamic definitions and the store used to retrieve their keys. A key observed in another instance or environment does not automatically exist in the instance evaluating these requests. Identify the partition definition and instance together during recovery. Task contracts should also specify whether a collection’s key denotes a durable identity or a particular revision that requires separate processing.

Track the collection through production of its artifact

Inspect discovery, registration, requested execution and materialized output separately. Tool observations can preserve the collection key and run identity across those stages. A visible partition label is useful registry evidence, but the report consumer needs the resulting analysis artifact. This distinction explains why newly added keys may remain unmaterialized and supports deliberate recovery without repeatedly registering the same collection as though registration itself completed the user task.

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