Skip to content

Fetch entity types recursively when using --recursive

Erwan Rouchet requested to merge entity-types-recursive into master

Closes #110 (closed)

The export in the original issue is way too large to test easily, so I tested with a good old Balsac Annotated export. To reproduce the bug, use a grand-parent (or beyond) of an element with some transcription entities on it:

# Works
arkindex export ~/dl/balsac-annotated-20230208-104815.sqlite csv --output lol.csv --parent a513feba-eef5-465d-bfc6-f389768507c6 --with-entities
# Works
arkindex export ~/dl/balsac-annotated-20230208-104815.sqlite csv --output lol.csv --parent a513feba-eef5-465d-bfc6-f389768507c6 --with-entities --entities-recursive
# Works
arkindex export ~/dl/balsac-annotated-20230208-104815.sqlite csv --output lol.csv --parent a513feba-eef5-465d-bfc6-f389768507c6 --with-entities --recursive --entities-recursive
# Worksn't
arkindex export ~/dl/balsac-annotated-20230208-104815.sqlite csv --output lol.csv --parent a513feba-eef5-465d-bfc6-f389768507c6 --with-entities --recursive

When --recursive is set and not --entities-recursive, entity types are only retrieved for the parent and its direct children, even though more elements than those will be included.

Maybe with Peewee we could use a WHERE element_id IN (…) and use the existing element query to avoid this bug…

Edited by Erwan Rouchet

Merge request reports