Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions executorlib/standalone/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,13 @@ def add_element(arg, link_to, label=""):
return node_lst, edge_lst


def generate_task_hash_for_plotting(
task_dict: dict, future_hash_inverse_dict: dict
) -> bytes:
def generate_task_hash_for_plotting(task_dict: dict, future_hash_dict: dict) -> bytes:
"""
Generate a hash for a task dictionary.

Args:
task_dict (dict): Dictionary containing task information.
future_hash_inverse_dict (dict): Dictionary mapping future hash to future object.
future_hash_dict (dict): Dictionary mapping future hash to future object.

Returns:
bytes: Hash generated for the task dictionary.
Expand Down Expand Up @@ -121,12 +119,13 @@ def convert_arg(arg, future_hash_inverse_dict):
else:
return arg

future_hash_inverted_dict = {v: k for k, v in future_hash_dict.items()}
args_for_hash = [
convert_arg(arg=arg, future_hash_inverse_dict=future_hash_inverse_dict)
convert_arg(arg=arg, future_hash_inverse_dict=future_hash_inverted_dict)
for arg in task_dict["args"]
]
kwargs_for_hash = {
k: convert_arg(arg=v, future_hash_inverse_dict=future_hash_inverse_dict)
k: convert_arg(arg=v, future_hash_inverse_dict=future_hash_inverted_dict)
for k, v in task_dict["kwargs"].items()
}
return cloudpickle.dumps(
Expand Down
4 changes: 1 addition & 3 deletions executorlib/task_scheduler/interactive/dependency.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,7 @@ def submit( # type: ignore
}
task_hash = generate_task_hash_for_plotting(
task_dict=task_dict,
future_hash_inverse_dict={
v: k for k, v in self._future_hash_dict.items()
},
future_hash_dict=self._future_hash_dict,
)
self._future_hash_dict[task_hash] = f
self._task_hash_dict[task_hash] = task_dict
Expand Down
Loading