Skip to content

Cannot create a manual TranscriptionEntity when the exact same one has been created by a worker

An issue I found while removing worker_version_id from CreateTranscriptionEntity in #1420 (closed): If you create a manual TranscriptionEntity, then create the same TranscriptionEntity with a worker version or worker run ID, then everything is fine. But if you start with a TranscriptionEntity with a worker version or run ID, and then create a manual one, you get an error:

>>> cli.request('CreateTranscriptionEntity', body={
...     'transcription': TRANSCRIPTION_ID,
...     'entity': ENTITY_ID,
...     'offset': 42,
...     'length': 42,
...     'worker_run_id': WORKER_RUN_ID,
... })
{'entity': ...}
>>> cli.request('CreateTranscriptionEntity', body={
...     'transcription': TRANSCRIPTION_ID,
...     'entity': ENTITY_ID,
...     'offset': 42,
...     'length': 42,
...     # No version or run ID → manual
... })
Traceback (most recent call last):
<snip>
ErrorResponse: {'__all__': ['This entity is already linked to this transcription at this position.']}

This is similar to #761 (closed), which was for classifications from workers being blocked by manual classifications (the inverse of this situation).