mirror of
https://github.com/Unstructured-IO/unstructured.git
synced 2026-01-05 20:00:56 +00:00
This PR fixes an occasional `KeyError` when calling `assign_and_map_hash_ids`. - This happens when the input `elements` has duplicated element instances or metadata. - When there are duplications the logic to iterate through all elements and map their parent ids will raise an error when an already mapped parent id is up for mapping. - The fix adds a logic to check if the parent id exists in `old_to_new_mapping` and if it doesn't we skip mapping it ## test This PR adds a unit test on this case and the test would fail without the fix.