Skip to content
Snippets Groups Projects

Fix worker_run/version IDs

Merged Yoann Schneider requested to merge fix-wk-version-ids into main
All threads resolved!
1 file
+ 19
7
Compare changes
  • Side-by-side
  • Inline
@@ -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,
)
Loading