mirror of
https://github.com/gadievron/raptor.git
synced 2026-04-25 05:56:00 +03:00
[PR #8] [MERGED] fix: Remove redundant local 'import re' causing UnboundLocalError #20
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/raptor#20
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/gadievron/raptor/pull/8
Author: @gadievron
Created: 11/29/2025
Status: ✅ Merged
Merged: 11/29/2025
Merged by: @danielcuthbert
Base:
main← Head:fix/python-scoping-bug-providers📝 Commits (1)
ee1cf05fix: Remove redundant local 'import re' causing UnboundLocalError📊 Changes
1 file changed (+0 additions, -1 deletions)
View changed files
📝
packages/llm_analysis/llm/providers.py(+0 -1)📄 Description
Problem
Production failures in Ollama LLM provider with error:
Impact: 66 failures in single session (Nov 29, 2025)
Root Cause
OllamaProvider.generate_structured()had redundantimport reon line 416 inside an except block.Python treats imports as assignments, making
rea local variable for the entire function scope. When lines 350-402 tried to userebefore line 416 executed, Python raisedUnboundLocalError.Code structure:
Solution
Remove line 416. Module-level
import re(line 9) is sufficient for all uses.Verification
rein method all work with module-level importFiles Changed
packages/llm_analysis/llm/providers.py(-1 line)Testing
Verified by:
Risk: None - removes redundant code only
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.