Is there a dagster pattern that can utilize an ass...
# ask-community
s
Is there a dagster pattern that can utilize an asset to populate a DynamicPartition? I have a working sensor implementation that is fine, but I thought I would ask if there is a way to change from a "push" sensor approach to a "pull" freshness-policy/AutoMaterialization approach. The idea is to have a "child" partition trigger an upstream materialization (read a csv file), fill a dynamic partition, and then materialize the partitions that are missing.
🤖 1
j
hey @Sean Davis i haven’t tested this, but you might be able to add the partitions this way
Copy code
partitions_def = DynamicPartitionsDefinition(name="foo")
@asset 
def my_asset(context):
    context.instance.add_dynamic_partitions("foo", ["a"])
s
Thanks, @jamie. That works exactly as expected.