Hi! I recently upgraded to version 1.65.0 and now ...
# hamilton-help
k
Hi! I recently upgraded to version 1.65.0 and now I’m getting the following error when I try to call dr.display_all_functions("hamilton.png"). Am I doing something wrong or did something change? Also sorry for the lack of code blocks — I’m sending this from my phone :) Traceback (most recent call last): File "/Users/kyle.pounder/.vscode/extensions/ms-python.debugpy-2024.6.0-darwin-arm64/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_vars.py", line 268, in eval_in_context result = eval(compiled, global_vars, local_vars) File "string", line 1, in module File "/Users/kyle.pounder/.pyenv/versions/3.10.7/envs/hamilton-exploration/lib/python3.10/site-packages/hamilton/driver.py", line 57, in wrapped_fn return call_fn(*args, **kwargs) File "/Users/kyle.pounder/.pyenv/versions/3.10.7/envs/hamilton-exploration/lib/python3.10/site-packages/hamilton/driver.py", line 785, in display_all_functions return self.graph.display_all( File "/Users/kyle.pounder/.pyenv/versions/3.10.7/envs/hamilton-exploration/lib/python3.10/site-packages/hamilton/graph.py", line 783, in display_all return self.display( File "/Users/kyle.pounder/.pyenv/versions/3.10.7/envs/hamilton-exploration/lib/python3.10/site-packages/hamilton/graph.py", line 921, in display pathlib.Path(output_file_path).write_bytes(dot.pipe(**kwargs)) File "/Users/kyle.pounder/.pyenv/versions/3.10.7/envs/hamilton-exploration/lib/python3.10/site-packages/graphviz/piping.py", line 104, in pipe return self._pipe_legacy(format, File "/Users/kyle.pounder/.pyenv/versions/3.10.7/envs/hamilton-exploration/lib/python3.10/site-packages/graphviz/_tools.py", line 171, in wrapper return func(*args, **kwargs) File "/Users/kyle.pounder/.pyenv/versions/3.10.7/envs/hamilton-exploration/lib/python3.10/site-packages/graphviz/piping.py", line 121, in _pipe_legacy return self._pipe_future(format, File "/Users/kyle.pounder/.pyenv/versions/3.10.7/envs/hamilton-exploration/lib/python3.10/site-packages/graphviz/piping.py", line 161, in _pipe_future return self._pipe_lines(*args, input_encoding=self.encoding, **kwargs) File "/Users/kyle.pounder/.pyenv/versions/3.10.7/envs/hamilton-exploration/lib/python3.10/site-packages/graphviz/backend/piping.py", line 161, in pipe_lines proc = execute.run_check(cmd, capture_output=True, quiet=quiet, **kwargs) File "/Users/kyle.pounder/.pyenv/versions/3.10.7/envs/hamilton-exploration/lib/python3.10/site-packages/graphviz/backend/execute.py", line 76, in run_check proc = _run_input_lines(cmd, input_lines, kwargs=kwargs) File "/Users/kyle.pounder/.pyenv/versions/3.10.7/envs/hamilton-exploration/lib/python3.10/site-packages/graphviz/backend/execute.py", line 96, in _run_input_lines popen = subprocess.Popen(cmd, stdin=subprocess.PIPE, **kwargs) File "/Users/kyle.pounder/.pyenv/versions/3.10.7/envs/hamilton-exploration/lib/python3.10/site-packages/gevent/subprocess.py", line 808, in _init self._execute_child(args, executable, preexec_fn, close_fds, File "/Users/kyle.pounder/.pyenv/versions/3.10.7/envs/hamilton-exploration/lib/python3.10/site-packages/gevent/subprocess.py", line 1625, in _execute_child self.pid = fork_and_watch(self._on_child, self._loop, True, fork) File "/Users/kyle.pounder/.pyenv/versions/3.10.7/envs/hamilton-exploration/lib/python3.10/site-packages/gevent/os.py", line 426, in fork_and_watch pid = fork() File "/Users/kyle.pounder/.vscode/extensions/ms-python.debugpy-2024.6.0-darwin-arm64/bundled/libs/debugpy/_vendored/pydevd/_pydev_bundle/pydev_monkey.py", line 941, in new_fork if is_python(executable): File "/Users/kyle.pounder/.vscode/extensions/ms-python.debugpy-2024.6.0-darwin-arm64/bundled/libs/debugpy/_vendored/pydevd/_pydev_bundle/pydev_monkey.py", line 269, in is_python single_quote, double_quote = _get_str_type_compatible(path, ["'", '"']) File "/Users/kyle.pounder/.vscode/extensions/ms-python.debugpy-2024.6.0-darwin-arm64/bundled/libs/debugpy/_vendored/pydevd/_pydev_bundle/pydev_monkey.py", line 253, in _get_str_type_compatible ret.append(arg.decode('utf-8')) AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?_
šŸ‘€ 1
t
Very odd, what code are you executing?
k
dr.display_all_functions("hamilton.png") Just trying to save the DAG as a PNG
t
I saw you updated the comment! Just to confirm, you're using
1.65.0
because just pushed
1.66.0
today
k
Correct, 1.65.0
t
can you try
dr.display_all_functions("hamilton.png", keep_dot=True)
. It should use a different
graphviz
method to save the visualization
k
I still get the same error
t
Ok, last thing to try: can you do
my_viz = dr.display_all_functions()
(no arguments) and see if it errors? Alternatively, you could try to do
dr.display_all_functions()
in a notebook and see if it displays the visualization. From the error trace, the bug seems related to saving the visualization. If the bug persists, do you want to schedule a 15min call to investigate the bug?
k
The first my_viz = … works. So it does seem to be an issue when saving locally. Do you have a few mins to hop on a call to debug further?
t
I'm about to leave for an event, let's ping @Stefan Krawczyk, but otherwise I'll make time tomorrow. From the error, I suspect it has something to do with the content of this particular visualization. In the stack trace, the subprocess part is when graphviz tries to save the file. Maybe a problem with the name of a node or a type that should be displayed.
s
@Kyle Pounder happy to jump on
I have time over the next couple of hours
k
Can we do 2:30 PT? Thank you!
s
sounds good; invite sent.
šŸ‘ 1
to close this issue — it appeared to be an environmental graphviz problem.
brew install graphviz
was required in the right environment.