Is there a recommended practice for wrapping a DAG...
# hamilton-help
c
Is there a recommended practice for wrapping a DAG Hamilton workflow with a desktop (Tkinter or wxPython) GUI? I'm running the DAG Hamilton workflow with a subprocess call with PIPE. Error handling and stdout are predictably a mixed bag. I wanted the organization benefits of DAG Hamilton (it has helped me a lot - thank you), but I still have the need to present users with a run or launch button. I have an idea for a workaround for all this (I was under time constraints when I gave users a beta version of this workflow), but it's a hack. I've downloaded the DAG Hamilton source code and grep'd the subprocess module. It appears to be in a few critical spots in the code execution. It's an additional ask, but it there a place in the doc that would help me educate myself more on how DAG Hamilton roughly executes under the hood with regard to things like the subprocess module and ast.literal_eval on DAG Hamilton nodes (this, again, predictably errors out)? I don't quite have the chops or time to do a full on dive into the DAG Hamilton source, but I'm competent enough to get my head around some basics. Thanks as always for both the product and your patience.
e
Hey! Curious — what’s going wrong with subprocess.pipe? We don’t have examples of Hamilton with GUIs, but we do have streamlit (might be interesting). The execution is pretty simple btw — it’s all in a python function. You can see the main function (for simple DAGs) here: https://github.com/DAGWorks-Inc/hamilton/blob/a483a0714dd077a4395574cb28983a1c8feaa36c/hamilton/execution/graph_functions.py#L149. If it’s a question of just running, waiting, and erroring out if there’s an exception, then it should be pretty easy. If you’re looking to get progress, you might want to consider hooks as well that, say, print to stdout: https://hamilton.dagworks.io/en/latest/reference/lifecycle-hooks/
c
Thanks, Elijah. I will try to put together a mockup and reproduce the inconsistencies (errors getting thrown, but the workflow continues to grind out <sometimes>, etc.). It may take a few days.
e
Great! Curious what you find.