Delete dynamic partition with API call from daemon/code deployment k8s pod #20933
Replies: 2 comments 1 reply
-
You can delete dynamic partitions programmatically using the DagsterInstance.delete_dynamic_partition method. This method allows you to delete a partition for the specified Here's how you can access the from dagster import DagsterInstance
# Get the current Dagster instance
instance = DagsterInstance.get()
# Delete a dynamic partition
instance.delete_dynamic_partition("my_partitions_def_name", "partition_key_to_delete") This code can be executed within the Kubernetes pod that is running your Dagster daemon or code deployment. You would need to ensure that the code has access to the Dagster instance, which is typically configured through environment variables or a Keep in mind that this action should be taken with caution, as deleting partitions can affect the downstream dependencies and consumers of the data associated with those partitions. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the response! |
Beta Was this translation helpful? Give feedback.
-
I've created a job where I can delete dynamic partitions.
But that got me wondering if there is a way to do that straight from daemon/code deployment (inside the k8s pod itself) with an API call?
Beta Was this translation helpful? Give feedback.
All reactions