Fix text unit incremental ID updates (#1734)

* Increment text_unit ids during incremental

* Semver
This commit is contained in:
Nathan Evans 2025-02-24 14:58:00 -08:00 committed by GitHub
parent a932b2d342
commit faa05b691f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 0 deletions

View File

@ -0,0 +1,4 @@
{
"type": "patch",
"description": "Properly increment text unit IDs during updates."
}

View File

@ -301,6 +301,10 @@ def _update_and_merge_text_units(
lambda x: [entity_id_mapping.get(i, i) for i in x] if x is not None else x lambda x: [entity_id_mapping.get(i, i) for i in x] if x is not None else x
) )
initial_id = old_text_units["human_readable_id"].max() + 1
delta_text_units["human_readable_id"] = np.arange(
initial_id, initial_id + len(delta_text_units)
)
# Merge the final text units # Merge the final text units
return pd.concat([old_text_units, delta_text_units], ignore_index=True, copy=False) return pd.concat([old_text_units, delta_text_units], ignore_index=True, copy=False)