Closed rhpvorderman closed 7 years ago
I just tested for item in dm.get('items',[]):
It gives the following error:
Traceback (most recent call last):
File "/home/ruben/ephemeris/.venv/bin/run-data-managers", line 11, in <module>
load_entry_point('ephemeris==0.6.2.dev0', 'console_scripts', 'run-data-managers')()
File "/home/ruben/ephemeris/.venv/lib/python2.7/site-packages/ephemeris-0.6.2.dev0-py2.7.egg/ephemeris/run_data_managers.py", line 80, in main
run_dm(args)
File "/home/ruben/ephemeris/.venv/lib/python2.7/site-packages/ephemeris-0.6.2.dev0-py2.7.egg/ephemeris/run_data_managers.py", line 56, in run_dm
job = gi.tools.run_tool(history_id=None, tool_id=dm_id, tool_inputs=inputs)
File "/home/ruben/ephemeris/.venv/lib/python2.7/site-packages/bioblend-0.8.0-py2.7.egg/bioblend/galaxy/tools/__init__.py", line 113, in run_tool
return self._tool_post(payload)
File "/home/ruben/ephemeris/.venv/lib/python2.7/site-packages/bioblend-0.8.0-py2.7.egg/bioblend/galaxy/tools/__init__.py", line 219, in _tool_post
return Client._post(self, payload, files_attached=files_attached)
File "/home/ruben/ephemeris/.venv/lib/python2.7/site-packages/bioblend-0.8.0-py2.7.egg/bioblend/galaxy/client.py", line 157, in _post
files_attached=files_attached)
File "/home/ruben/ephemeris/.venv/lib/python2.7/site-packages/bioblend-0.8.0-py2.7.egg/bioblend/galaxyclient.py", line 134, in make_post_request
body=r.text, status_code=r.status_code)
bioblend.ConnectionError: Unexpected HTTP status code: 400: {"err_data": {"all_fasta_source": "Parameter all_fasta_source requires a value, but has no legal values defined."}, "err_msg": "Parameter all_fasta_source requires a value, but has no legal values defined.", "err_code": 0}
for item in dm.get('items',['']):
works fine. I believe there has to be an item in the list in order for the for item
statement to work. It just skips the code block when there are no items defined (which is the most logical behaviour). But the code block should not be skipped, so an empty string is a good placeholder.
Thanks for trying it out.
Sometimes no items are needed for run-data-managers, see the following file:
However, run-data-managers throws the following error when the file is run:
The fix is to default items to empty string instead of None.