When attempting to download a dataset with no output format (e.g., omitting to-subdir-ic for image classification dataset), then the backend dies with the stacktrace below.
Fix: if no output format defined (eg when the stage_args list is empty), return an error stating that an output format is required.
Internal Server Error: /v1/classify/datasets/11/download
Traceback (most recent call last):
File "/ufdl/ufdl-backend/venv.dev/lib/python3.7/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/ufdl/ufdl-backend/venv.dev/lib/python3.7/site-packages/django/core/handlers/base.py", line 115, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/ufdl/ufdl-backend/venv.dev/lib/python3.7/site-packages/django/core/handlers/base.py", line 113, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/ufdl/ufdl-backend/venv.dev/lib/python3.7/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
return view_func(*args, **kwargs)
File "/ufdl/ufdl-backend/venv.dev/lib/python3.7/site-packages/rest_framework/viewsets.py", line 125, in view
return self.dispatch(request, *args, **kwargs)
File "/ufdl/ufdl-backend/venv.dev/lib/python3.7/site-packages/rest_framework/views.py", line 509, in dispatch
response = self.handle_exception(exc)
File "/ufdl/ufdl-backend/venv.dev/lib/python3.7/site-packages/rest_framework/views.py", line 469, in handle_exception
self.raise_uncaught_exception(exc)
File "/ufdl/ufdl-backend/venv.dev/lib/python3.7/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
raise exc
File "/ufdl/ufdl-backend/venv.dev/lib/python3.7/site-packages/rest_framework/views.py", line 506, in dispatch
response = handler(request, *args, **kwargs)
File "/ufdl/ufdl-backend/venv.dev/lib/python3.7/site-packages/ufdl/core_app/views/mixins/_DownloadableViewSet.py", line 79, in download
return Response(data=obj.as_file(file_format, **parameters),
File "/ufdl/ufdl-backend/venv.dev/lib/python3.7/site-packages/ufdl/core_app/models/_Dataset.py", line 299, in as_file
return self.as_zip()
File "/ufdl/ufdl-backend/venv.dev/lib/python3.7/site-packages/ufdl/core_app/models/_Dataset.py", line 358, in as_zip
for filename, contents in self.archive_file_iterator():
File "/ufdl/ufdl-backend/venv.dev/lib/python3.7/site-packages/ufdl/core_app/models/_Dataset.py", line 329, in archive_file_iterator
*annotations_args
File "/ufdl/ufdl-backend/venv.dev/lib/python3.7/site-packages/ufdl/annotation_utils/_converted_annotations_iterator.py", line 42, in converted_annotations_iterator
if "-o" not in stage_args[-1] and "--output" not in stage_args[-1]:
IndexError: list index out of range
When attempting to download a dataset with no output format (e.g., omitting
to-subdir-ic
for image classification dataset), then the backend dies with the stacktrace below.Fix: if no output format defined (eg when the stage_args list is empty), return an error stating that an output format is required.