You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[2.0] Fix spaCy model loading in ingestion CI - #36177
Backport of #36176; validated independently against the 2.0 ingestion package.
Fixes ingestion CI image builds and auto-classification initialization failing while loading en_core_web_md with OverflowError: Python int too large to convert to C ssize_t.
preshed==3.0.14 rejects unsigned 64-bit tokenizer hashes. Constrain it to <3.0.14 in the pii-processor, sample-data, and presidio-analyzer extras. Aggregate extras inherit the constraint, covering OSS and Collate ingestion installs. This is a temporary compatibility constraint; newer preshed releases require verification before relaxing it.
Type of change:
Bug fix
High-level design:
Not applicable — one-file dependency compatibility fix. No Dockerfile, workflow, or application changes.
Verification:
Built wheels before and after the change and checked metadata for nine extras: pii-processor, sample-data, presidio-analyzer, all, all-dev-env, slim, playwright, test, and dev. The new constraint is present in all nine.
In a non-root Python 3.12 ARM64 ingestion container, reproduced the exact overflow with preshed==3.0.14 and en_core_web_md==3.8.0.
Installed each of the three changed extras' requirements from the built wheel using pip's normal resolver. All three selected preshed==3.0.13; fresh-process model loading and entity recognition passed (3/3).
Separately, in the main-branch ingestion image, reproduced the failing metadata install-classification-models --languages en command, then changed only preshed to 3.0.13 and reran it successfully. Other newly released native dependencies remained unchanged.
ruff check ingestion/setup.py, ruff format --check ingestion/setup.py, and git diff --check passed.
Unit coverage: not applicable to dependency metadata. No runtime module or connector changed; no pytest, Java, or Playwright suites were run. Full CI image build and AMD64 validation remain for CI.
Manual testing performed:
Install preshed 3.0.14 and load en_core_web_md to reproduce the overflow. Install the updated extra requirements and repeat model loading plus recognition of a synthetic sentence; both succeed with preshed 3.0.13.
UI screen recording:
Not applicable — no UI changes.
Checklist:
Reviewed the committed diff against REVIEW.md; no blocking findings. ingestion/setup.py maps to the built-wheel metadata, real pip resolver, and model-loading checks above.
Dependency workaround includes an explanatory comment.
Decision check: no new architectural decision; this restores dependency compatibility.
Issue/title metadata: CI regression fix; no linked issue (skip-pr-checks).
Schema migrations and backend integration tests: not applicable.
🟡 Medium risk · Pinning preshed below 3.0.14 across ingestion extras changes dependency resolution and could conflict with packages requiring newer releases.
Constrains preshed to <3.0.14 in the pii-processor, sample-data, and presidio-analyzer extras to fix the OverflowError when loading en_core_web_md during ingestion CI and classification initialization. The change has an open important finding: the test extra adds spacy directly without the preshed constraint, so pip install ingestion[test] alone can still resolve preshed==3.0.14. Add VERSIONS["preshed"] alongside VERSIONS["spacy"] in test in ingestion/setup.py before merge.
✅ 1 closedClosed: Edge Case:test extra pulls spaCy without the new preshed<3.0.14 constraint
📄 ingestion/setup.py:542📄 ingestion/setup.py:70
The test set adds VERSIONS["spacy"] directly (setup.py:542), but it does not pull in any plugin that carries VERSIONS["preshed"]. So pip install ingestion[test] on its own (for example make install_test in ingestion/Makefile:31) can still resolve preshed==3.0.14, and any test that loads en_core_web_md will hit the same OverflowError. The CI action is safe only because it installs [all] before [test]. This also conflicts with the PR description, which says the constraint shows up in the test extra's metadata. The fix is to add VERSIONS["preshed"] next to VERSIONS["spacy"] in test. A stronger option is to add it everywhere spaCy is listed, so no extra can install spaCy without the pin.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your changes:
Backport of #36176; validated independently against the 2.0 ingestion package.
Fixes ingestion CI image builds and auto-classification initialization failing while loading
en_core_web_mdwithOverflowError: Python int too large to convert to C ssize_t.preshed==3.0.14rejects unsigned 64-bit tokenizer hashes. Constrain it to<3.0.14in thepii-processor,sample-data, andpresidio-analyzerextras. Aggregate extras inherit the constraint, covering OSS and Collate ingestion installs. This is a temporary compatibility constraint; newer preshed releases require verification before relaxing it.Type of change:
High-level design:
Not applicable — one-file dependency compatibility fix. No Dockerfile, workflow, or application changes.
Verification:
pii-processor,sample-data,presidio-analyzer,all,all-dev-env,slim,playwright,test, anddev. The new constraint is present in all nine.preshed==3.0.14anden_core_web_md==3.8.0.preshed==3.0.13; fresh-process model loading and entity recognition passed (3/3).metadata install-classification-models --languages encommand, then changed only preshed to 3.0.13 and reran it successfully. Other newly released native dependencies remained unchanged.ruff check ingestion/setup.py,ruff format --check ingestion/setup.py, andgit diff --checkpassed.Manual testing performed:
Install preshed 3.0.14 and load
en_core_web_mdto reproduce the overflow. Install the updated extra requirements and repeat model loading plus recognition of a synthetic sentence; both succeed with preshed 3.0.13.UI screen recording:
Not applicable — no UI changes.
Checklist:
REVIEW.md; no blocking findings.ingestion/setup.pymaps to the built-wheel metadata, real pip resolver, and model-loading checks above.skip-pr-checks).Reviewed commit:
93e25b87c5d176c90d4c63f0bb2867a0751b56ab.

Confidence Score: 5/5
The PR appears safe to merge.Summary
Adds
preshed<3.0.14to avoid the reported spaCy model-loading failure.preshedso spaCy models can load.Reviews (1) · Last reviewed commit: "Fix spaCy tokenizer overflow in ingestio..." · Reviewed by Greptile