hey guys – tried to find an example, is it possibl...
# ask-community
k
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
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
what @Vinnie said is exactly right we would like to make something like what you suggested possible in the future though
👍 1