Skip to content

[2.0] Fix spaCy model loading in ingestion CI - #36177

Merged
pmbrull merged 1 commit into
2.0from
fix/2.0-spacy-preshed-tokenizer-overflow
Oct 25, 2026
Merged

pmbrull merged 1 commit into
2.0from
fix/2.0-spacy-preshed-tokenizer-overflow

Conversation

@IceS2

@IceS2 IceS2 commented Oct 25, 2026 •

Copy link
Copy Markdown
Collaborator

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_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.

Reviewed commit: 93e25b87c5d176c90d4c63f0bb2867a0751b56ab.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge.

Summary

Adds preshed<3.0.14 to avoid the reported spaCy model-loading failure.

  • Ingestion extras cap preshed so spaCy models can load.

Reviews (1) · Last reviewed commit: "Fix spaCy tokenizer overflow in ingestio..." · Reviewed by Greptile

@IceS2
IceS2 requested a review from a team as a code owner October 25, 2026 06:44
@IceS2 IceS2 added the skip-pr-checks Bypass PR metadata validation check label Oct 25, 2026
@IceS2
IceS2 requested review from mohittilala and removed request for a team October 25, 2026 06:44
@github-actions github-actions Bot added Ingestion safe to test Add this label to run secure Github workflows on PRs labels Oct 25, 2026
Comment thread ingestion/setup.py Resolved
@gitar-bot

gitar-bot Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved 1 closed / 1 findings

🟡 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 closed
Closed: 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.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@IceS2
IceS2 enabled auto-merge (squash) October 25, 2026 06:51
@sonarqubecloud

Copy link
Copy Markdown

@pmbrull
pmbrull disabled auto-merge October 25, 2026 07:26
@pmbrull
pmbrull merged commit 6b0cff8 into 2.0 Oct 25, 2026
85 of 96 checks passed
@pmbrull
pmbrull deleted the fix/2.0-spacy-preshed-tokenizer-overflow branch October 25, 2026 07:26

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ingestion safe to test Add this label to run secure Github workflows on PRs skip-pr-checks Bypass PR metadata validation check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants