Skip to content

Commit

Permalink
fix(execution): Fix support for input-less nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
M1kep committed Aug 1, 2023
1 parent 7785d07 commit 90b0163
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ def map_node_over_list(obj, input_data_all, func, allow_interrupt=False):
if hasattr(obj, "INPUT_IS_LIST"):
input_is_list = obj.INPUT_IS_LIST

max_len_input = max([len(x) for x in input_data_all.values()])
if len(input_data_all) == 0:
max_len_input = 0
else:
max_len_input = max([len(x) for x in input_data_all.values()])

# get a slice of inputs, repeat last input when list isn't long enough
def slice_dict(d, i):
Expand All @@ -60,7 +63,11 @@ def slice_dict(d, i):
if allow_interrupt:
nodes.before_node_execution()
results.append(getattr(obj, func)(**input_data_all))
else:
elif max_len_input == 0:
if allow_interrupt:
nodes.before_node_execution()
results.append(getattr(obj, func)())
else:
for i in range(max_len_input):
if allow_interrupt:
nodes.before_node_execution()
Expand Down

0 comments on commit 90b0163

Please sign in to comment.