https://dagster.io/ logo
#ask-ai
Title
# ask-ai
c

Caelan Schneider

02/26/2024, 2:27 PM
What are the dagster tags generated when you specify a partition range?
s

Scout

02/26/2024, 2:27 PM
When specifying a partition range in Dagster, the tags that are generated typically include information that identifies the range of partitions for which a run is being executed. These tags are used to provide context and metadata for the run, and they can be particularly useful for filtering and organizing runs in the Dagster UI. Based on the documentation, when you specify a partition range, you might see tags such as: - `"dagster/asset_partition_range_start"`: This tag represents the start of the partition range. It is associated with the first partition key in the range. - `"dagster/asset_partition_range_end"`: This tag represents the end of the partition range. It is associated with the last partition key in the range. Here is an example from the documentation that illustrates how these tags can be used in a `RunRequest`:
Copy code
python return RunRequest(     tags={         "dagster/asset_partition_range_start": MultiPartitionKey(             {                 "my_crypto_tokens": dynamic_partitions_def.get_first_partition_key(                     dynamic_partitions_store=context.instance                 ),                 "hour": hour_partition_key,             }         ),         "dagster/asset_partition_range_end": MultiPartitionKey(             {                 "my_crypto_tokens": dynamic_partitions_def.get_last_partition_key(                     dynamic_partitions_store=context.instance                 ),                 "hour": hour_partition_key,             }         ),     } )
In this example,
MultiPartitionKey
is used to specify the start and end of the partition range for multiple dimensions of partitioning. The
dynamic_partitions_def.get_first_partition_key
and
dynamic_partitions_def.get_last_partition_key
methods are used to retrieve the first and last partition keys, respectively, from a dynamic partitions definition. Please note that the exact tags and their usage may vary depending on the specific implementation and version of Dagster you are using. Always refer to the latest Dagster documentation for the most accurate and up-to-date information.
3 Views