Skip to content

Commit

Permalink
Fix parameter display for tools with sections
Browse files Browse the repository at this point in the history
Fixes:

```
Message
Uncaught exception in exposed API method:
Stack Trace(most recent call first)

TypeError: Object of type method is not JSON serializable
  File "galaxy/util/json.py", line 74, in safe_dumps
    dumped = json.dumps(obj, allow_nan=False, **kwargs)
  File "__init__.py", line 234, in dumps
    return cls(
  File "json/encoder.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "json/encoder.py", line 257, in iterencode
    return _iterencode(o, 0)
  File "json/encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type method is not JSON serializable
  File "galaxy/web/framework/decorators.py", line 341, in decorator
    rval = format_return_as_json(rval, jsonp_callback, pretty=trans.debug)
  File "galaxy/web/framework/decorators.py", line 378, in format_return_as_json
    json = safe_dumps(rval, **dumps_kwargs)
  File "galaxy/util/json.py", line 77, in safe_dumps
    dumped = json.dumps(obj, allow_nan=False, **kwargs)
  File "__init__.py", line 234, in dumps
    return cls(
  File "json/encoder.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "json/encoder.py", line 257, in iterencode
    return _iterencode(o, 0)
  File "json/encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
```

from https://sentry.galaxyproject.org/share/issue/665556bc240f4a04978f7c81c2be629c/
  • Loading branch information
mvdbeek committed Oct 9, 2023
1 parent 7b978a0 commit 4df4901
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 0 additions & 2 deletions lib/galaxy/managers/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -965,8 +965,6 @@ def inputs_recursive(input_params, param_values, depth=1, upgrade_messages=None)
# Get parameter label.
if input.type == "conditional":
label = input.test_param.label
elif input.type == "repeat":
label = input.label()
else:
label = input.label or input.name
rval.append(
Expand Down
2 changes: 2 additions & 0 deletions lib/galaxy/tools/parameters/grouping.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ def title(self, value):
def title_plural(self):
return inflector.pluralize(self.title)

@property
def label(self):
return f"Repeat ({self.title})"

Expand Down Expand Up @@ -183,6 +184,7 @@ def __init__(self):
def title_plural(self):
return inflector.pluralize(self.title)

@property
def label(self):
return f"Section ({self.title})"

Expand Down

0 comments on commit 4df4901

Please sign in to comment.