diff --git a/lib/galaxy/tools/parameters/basic.py b/lib/galaxy/tools/parameters/basic.py index 613264c45e99..5d96697d1eac 100644 --- a/lib/galaxy/tools/parameters/basic.py +++ b/lib/galaxy/tools/parameters/basic.py @@ -464,7 +464,7 @@ def __init__(self, tool, input_source): if self.min is not None or self.max is not None: self.validators.append(validation.InRangeValidator(None, self.min, self.max)) - def from_json(self, value, trans, other_values=None): + def from_json(self, value, trans=None, other_values=None): other_values = other_values or {} try: return int(value) @@ -536,7 +536,7 @@ def __init__(self, tool, input_source): if self.min is not None or self.max is not None: self.validators.append(validation.InRangeValidator(None, self.min, self.max)) - def from_json(self, value, trans, other_values=None): + def from_json(self, value, trans=None, other_values=None): other_values = other_values or {} try: return float(value) @@ -992,7 +992,10 @@ def get_legal_names(self, trans, other_values): """ return {n: v for n, v, _ in self.get_options(trans, other_values)} - def from_json(self, value, trans, other_values=None, require_legal_value=True): + def from_json(self, value, trans=None, other_values=None): + return self._select_from_json(value, trans, other_values=other_values, require_legal_value=True) + + def _select_from_json(self, value, trans, other_values=None, require_legal_value=True): other_values = other_values or {} try: legal_values = self.get_legal_values(trans, other_values, value) @@ -1268,7 +1271,7 @@ def __init__(self, tool, input_source): self.default_value = input_source.get("value", None) self.is_dynamic = True - def from_json(self, value, trans, other_values=None): + def from_json(self, value, trans=None, other_values=None): other_values = other_values or {} if self.multiple: tag_list = [] @@ -1290,7 +1293,7 @@ def from_json(self, value, trans, other_values=None): value = None # We skip requiring legal values -- this is similar to optional, but allows only subset of datasets to be positive # TODO: May not actually be required for (nested) collection input ? - return super().from_json(value, trans, other_values, require_legal_value=False) + return super()._select_from_json(value, trans, other_values, require_legal_value=False) def get_tag_list(self, other_values): """ @@ -1395,7 +1398,7 @@ def to_json(self, value, app, use_security): return value.strip() return value - def from_json(self, value, trans, other_values=None): + def from_json(self, value, trans=None, other_values=None): """ Label convention prepends column number with a 'c', but tool uses the integer. This removes the 'c' when entered into a workflow. @@ -1710,7 +1713,7 @@ def recurse_options(legal_values, options): recurse_options(legal_values, self.get_options(trans=trans, other_values=other_values)) return legal_values - def from_json(self, value, trans, other_values=None): + def from_json(self, value, trans=None, other_values=None): other_values = other_values or {} legal_values = self.get_legal_values(trans, other_values, value) if not legal_values and trans.workflow_building_mode: @@ -2111,7 +2114,7 @@ def __init__(self, tool, input_source, trans=None): ) self.conversions.append((name, conv_extension, [conv_type])) - def from_json(self, value, trans, other_values=None): + def from_json(self, value, trans=None, other_values=None): session = trans.sa_session other_values = other_values or {} @@ -2468,7 +2471,7 @@ def match_multirun_collections(self, trans, history, dataset_collection_matcher) if match: yield history_dataset_collection, match.implicit_conversion - def from_json(self, value, trans, other_values=None): + def from_json(self, value, trans=None, other_values=None): session = trans.sa_session other_values = other_values or {}