Describe the bug
label-studio-1 | [2026-04-13 12:31:47,128] [core.utils.common::custom_exception_handler::97] [ERROR] eaa1da07-eb27-453b-b1a0-ad5524e5b24d 'BaseTaskSerializerBulk' object has no attribute 'db_predictions'
label-studio-1 | Traceback (most recent call last):
label-studio-1 | File "/label-studio/.venv/lib/python3.13/site-packages/rest_framework/views.py", line 506, in dispatch
label-studio-1 | response = handler(request, *args, **kwargs)
label-studio-1 | File "/label-studio/label_studio/data_import/api.py", line 759, in post
label-studio-1 | return super(ReImportAPI, self).post(*args, **kwargs)
label-studio-1 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
label-studio-1 | File "/label-studio/.venv/lib/python3.13/site-packages/django/utils/decorators.py", line 48, in _wrapper
label-studio-1 | return bound_method(*args, **kwargs)
label-studio-1 | File "/label-studio/label_studio/data_import/api.py", line 271, in post
label-studio-1 | return super(ImportAPI, self).post(*args, **kwargs)
label-studio-1 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
label-studio-1 | File "/label-studio/.venv/lib/python3.13/site-packages/rest_framework/generics.py", line 194, in post
label-studio-1 | return self.create(request, *args, **kwargs)
label-studio-1 | ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
label-studio-1 | File "/label-studio/label_studio/core/utils/common.py", line 353, in f_retry
label-studio-1 | return f(*args, **kwargs)
label-studio-1 | File "/label-studio/label_studio/data_import/api.py", line 749, in create
label-studio-1 | return self.sync_reimport(project, file_upload_ids, files_as_tasks_list)
label-studio-1 | ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
label-studio-1 | File "/label-studio/label_studio/data_import/api.py", line 670, in sync_reimport
label-studio-1 | prediction_count = len(serializer.db_predictions)
label-studio-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^
label-studio-1 | AttributeError: 'BaseTaskSerializerBulk' object has no attribute 'db_predictions'. Did you mean: 'add_predictions'?
To Reproduce
Steps to reproduce the behavior:
- Import label studio JSON with predictions.
- Label and submit.
- export as label studio JSON
- Try to import the file.
- Boom
It seems like it turns the predictions into something like
"predictions" : [ 22 ],
which makes it blow up
Describe the bug
label-studio-1 | [2026-04-13 12:31:47,128] [core.utils.common::custom_exception_handler::97] [ERROR] eaa1da07-eb27-453b-b1a0-ad5524e5b24d 'BaseTaskSerializerBulk' object has no attribute 'db_predictions'
label-studio-1 | Traceback (most recent call last):
label-studio-1 | File "/label-studio/.venv/lib/python3.13/site-packages/rest_framework/views.py", line 506, in dispatch
label-studio-1 | response = handler(request, *args, **kwargs)
label-studio-1 | File "/label-studio/label_studio/data_import/api.py", line 759, in post
label-studio-1 | return super(ReImportAPI, self).post(*args, **kwargs)
label-studio-1 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
label-studio-1 | File "/label-studio/.venv/lib/python3.13/site-packages/django/utils/decorators.py", line 48, in _wrapper
label-studio-1 | return bound_method(*args, **kwargs)
label-studio-1 | File "/label-studio/label_studio/data_import/api.py", line 271, in post
label-studio-1 | return super(ImportAPI, self).post(*args, **kwargs)
label-studio-1 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
label-studio-1 | File "/label-studio/.venv/lib/python3.13/site-packages/rest_framework/generics.py", line 194, in post
label-studio-1 | return self.create(request, *args, **kwargs)
label-studio-1 | ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
label-studio-1 | File "/label-studio/label_studio/core/utils/common.py", line 353, in f_retry
label-studio-1 | return f(*args, **kwargs)
label-studio-1 | File "/label-studio/label_studio/data_import/api.py", line 749, in create
label-studio-1 | return self.sync_reimport(project, file_upload_ids, files_as_tasks_list)
label-studio-1 | ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
label-studio-1 | File "/label-studio/label_studio/data_import/api.py", line 670, in sync_reimport
label-studio-1 | prediction_count = len(serializer.db_predictions)
label-studio-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^
label-studio-1 | AttributeError: 'BaseTaskSerializerBulk' object has no attribute 'db_predictions'. Did you mean: 'add_predictions'?
To Reproduce
Steps to reproduce the behavior:
It seems like it turns the predictions into something like
"predictions" : [ 22 ],
which makes it blow up