https://dagster.io/ logo
#ask-community
Title
# ask-community
k

Kevin Schaich

03/06/2023, 1:11 AM
hey guys – tried to find an example, is it possible to use the new
DynamicPartitionsDefinition
directly in an asset (without a sensor)? e.g. something like:
Copy code
images_partitions_def = DynamicPartitionsDefinition(name="images")

@asset(partitions_def=images_partitions_def)
def images(context):
    ...
    images = get_data()

    for image in images:
        images_partitions_def.add_partition(image.name)
        yield Output(image, partition=image.name)
dagster bot responded by community 1
v

Vinnie

03/06/2023, 10:44 AM
AFAIK you could add the partition to the asset within the asset process, but you can’t transform a run previously launched to target this new partition.
👍 1
s

sandy

03/07/2023, 3:49 AM
what @Vinnie said is exactly right we would like to make something like what you suggested possible in the future though
👍 1
4 Views