KeyError on element_type on the Files import
When running any file import with a fresh tasks build from master, we get this:
[INFO] Downloaded 14 files
[INFO] Using folder fd4f77c6-b700-4518-969e-2d6ce9f9499c "Import images 2020-06-30 13:20"
[INFO] Retrieving existing elements in folder
Traceback (most recent call last):
File "/usr/local/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/local/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/local/lib/python3.6/site-packages/arkindex_tasks/import_files/__main__.py", line 29, in <module>
main()
File "/usr/local/lib/python3.6/site-packages/arkindex_tasks/import_files/__main__.py", line 25, in main
FileImport(**args).run()
File "/usr/local/lib/python3.6/site-packages/arkindex_tasks/import_files/base.py", line 151, in run
type=self.dataimport["payload"]["element_type"],
KeyError: 'element_type'
The file import still retrieves the element type from the payload, because both the file and IIIF imports were to be handled in backend#297 (closed). However, updates to the DataImport
on the backend caused element_type
to go missing from the payload too early.