https://dagster.io/ logo
Title
k

Kate Ross

05/18/2023, 8:40 AM
Hello all! I am wondering what the best way is to remove dynamic partition keys once they have been added (note: I don’t mean just removing the materializations, but also the keys). Is this something that can be done through graphql? Has anyone done this?
c

claire

05/18/2023, 4:32 PM
Hi Kate. You could do it within a sensor (untested code):
dynamic_partitions_def = DynamicPartitionsDefinition(name="foo")

@sensor
def remove_dynamic_partitions_sensor(context):
    return SensorResult(
        dynamic_partitions_requests=[dynamic_partitions_def.build_delete_request(partition_keys)]
    )
currently this is not possible through graphQL, you'd have to do it through code
👍 1
k

Kate Ross

05/18/2023, 7:39 PM
Thanks Claire, I will try it out