Skip to content
Snippets Groups Projects
Verified Commit af3ec31f authored by Yoann Schneider's avatar Yoann Schneider :tennis:
Browse files

Fix worker_run/version IDs

parent 5003366e
No related branches found
No related tags found
1 merge request!18Fix worker_run/version IDs
Pipeline #144863 passed
This commit is part of merge request !18. Comments created here will be created in the context of that merge request.
......@@ -147,7 +147,9 @@ class DatasetExtractor(DatasetWorker):
class_name=classification.class_name,
confidence=classification.confidence,
state=classification.state,
worker_run_id=classification.worker_run,
worker_run_id=classification.worker_run.id
if classification.worker_run
else None,
)
for classification in list_classifications(element.id)
]
......@@ -170,8 +172,12 @@ class DatasetExtractor(DatasetWorker):
text=transcription.text,
confidence=transcription.confidence,
orientation=DEFAULT_TRANSCRIPTION_ORIENTATION,
worker_version_id=transcription.worker_version,
worker_run_id=transcription.worker_run,
worker_version_id=transcription.worker_version.id
if transcription.worker_version
else None,
worker_run_id=transcription.worker_run.id
if transcription.worker_run
else None,
)
for transcription in list_transcriptions(element.id)
]
......@@ -196,7 +202,9 @@ class DatasetExtractor(DatasetWorker):
name=transcription_entity.entity.name,
validated=transcription_entity.entity.validated,
metas=transcription_entity.entity.metas,
worker_run_id=transcription_entity.entity.worker_run,
worker_run_id=transcription_entity.entity.worker_run.id
if transcription_entity.entity.worker_run
else None,
)
entities.append(entity)
transcription_entities.append(
......@@ -207,7 +215,9 @@ class DatasetExtractor(DatasetWorker):
offset=transcription_entity.offset,
length=transcription_entity.length,
confidence=transcription_entity.confidence,
worker_run_id=transcription_entity.worker_run,
worker_run_id=transcription_entity.worker_run.id
if transcription_entity.worker_run
else None,
)
)
if entities:
......@@ -279,8 +289,10 @@ class DatasetExtractor(DatasetWorker):
polygon=element.polygon,
rotation_angle=element.rotation_angle,
mirrored=element.mirrored,
worker_version_id=element.worker_version,
worker_run_id=element.worker_run,
worker_version_id=element.worker_version.id
if element.worker_version
else None,
worker_run_id=element.worker_run.id if element.worker_run else None,
confidence=element.confidence,
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment