Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: prevent unintended shared metadata updates in function assign_and_map_hash_ids #3385

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

non-nil
Copy link

@non-nil non-nil commented Jul 11, 2024

short description

This short PR addresses a bug in the assign_and_map_hash_ids function where multiple Element instances could share the same ElementMetadata instance.

This could inadvertently introduce unintended side effects when updating the parent_id.

original behavior

Here it will raise the KeyError since the underlying metadata object could have been updated earlier pointed by the other element associated with the same metadata object.

Copy link

sentry-io bot commented Jul 11, 2024

🔍 Existing Issues For Review

Your pull request is modifying functions with the following pre-existing issues:

📄 File: unstructured/documents/elements.py

Function Unhandled Issue
assign_and_map_hash_ids KeyError: 'd703f5515d88810d30db8779c12b0d18' /gen...
Event Count: 1

Did you find this useful? React with a 👍 or 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant