Hi guys, I am thinking about retrying and or repe...
# hamilton-help
v
Hi guys, I am thinking about retrying and or repeating the execution of a hamilton dataflow (graph execution). There are a lot of python modules (tenacity, retry, retry2, retrying,...) available for retry of failed functions. And eve creating one yourself is straight forward. Most of them can be used by adding a decorator to the function so can be used in hamilton for retrying node executions. However they can not be used for the graph execution. The same is true, for repeating the graph execution. Is there an adapter available for this? If not, is there some documentation on how to build an adapter?
s
I think this is something outside the current behaviors we have with the lifecycle adapters. So you’d need to handle this outside Hamilton. E.g. wrap the logic to execute the graph in a function and use a decorator on that? or wrap it in a while / for-loop?
v
Makes sense. Should be easy to implement in flowepower. However, a retrying adapter, that auto retires every node would be nice.
s
Oh at the node level yes. That is possible see https://hamilton.dagworks.io/en/latest/reference/lifecycle-hooks/NodeExecutionMethod/ Basically anything that can be modeled as a decorator can be injected via this approach. Note the caveat, that you can only have one adapter that implements this if you're using multiple adapters right now.