Skip to content

Commit

Permalink
Revert special casing display
Browse files Browse the repository at this point in the history
We don't want this in general Hamilton.
  • Loading branch information
skrawcz committed Feb 9, 2025
1 parent f384d58 commit bf03b31
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions hamilton/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
import inspect
import logging
import os.path

# import pathlib
import pathlib
import uuid
from enum import Enum
from types import ModuleType
Expand Down Expand Up @@ -939,15 +938,13 @@ def display(
# - `render()` accepts a `view` kwarg
# - `render()` will append it's kwarg `format` to the filename
if output_file_path:
with open(output_file_path + ".dot", "w") as f:
f.write(str(dot))
# if keep_dot:
# kwargs["view"] = kwargs.get("view", False)
# dot.render(output_file_path, **kwargs)
# else:
# kwargs.pop("view", None)
# output_file_path = f"{output_file_path}.{kwargs['format']}"
# pathlib.Path(output_file_path).write_bytes(dot.pipe(**kwargs))
if keep_dot:
kwargs["view"] = kwargs.get("view", False)
dot.render(output_file_path, **kwargs)
else:
kwargs.pop("view", None)
output_file_path = f"{output_file_path}.{kwargs['format']}"
pathlib.Path(output_file_path).write_bytes(dot.pipe(**kwargs))
return dot

def get_impacted_nodes(self, var_changes: List[str]) -> Set[node.Node]:
Expand Down

0 comments on commit bf03b31

Please sign in to comment.