Skip to content

Commit

Permalink
Fix test_run_with_optional_data_unspecified_survives_delayed_step
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek committed Dec 19, 2024
1 parent 2d42707 commit 133e7f5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/galaxy/tools/parameters/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,17 @@ def callback_helper(input, input_values, name_prefix, label_prefix, parent_prefi
if input.name not in input_values:
args["error"] = f"No value found for '{args.get('prefixed_label')}'."
new_value = callback(**args)

# is this good enough ? feels very ugh
if new_value == [no_replacement_value]:
# Single unspecified value in multiple="true" input with a single null input, pretend it's a singular value
new_value = no_replacement_value
if isinstance(new_value, list):
# Maybe mixed input, I guess tool defaults don't really make sense here ?
# Would e.g. be default dataset in multiple="true" input, you wouldn't expect the default to be inserted
# if other inputs are connected and provided.
new_value = [item if not item == no_replacement_value else None for item in new_value]

if no_replacement_value is REPLACE_ON_TRUTHY:
replace = bool(new_value)
else:
Expand Down

0 comments on commit 133e7f5

Please sign in to comment.