Skip to content

fix: add missing deps, fix Union import, remove redundant DB query#208

Open
utkarshqz wants to merge 1 commit intofireform-core:mainfrom
utkarshqz:fix/missing-deps-and-api-bugs
Open

fix: add missing deps, fix Union import, remove redundant DB query#208
utkarshqz wants to merge 1 commit intofireform-core:mainfrom
utkarshqz:fix/missing-deps-and-api-bugs

Conversation

@utkarshqz
Copy link

@utkarshqz utkarshqz commented Mar 8, 2026

Description

Fixes four bugs discovered during local setup and end-to-end testing of the API.

A fresh pip install -r requirements.txt on a clean environment fails immediately because python-multipart (required by FastAPI for file uploads) and pypdf (imported in api/routes/templates.py) are missing from the dependency list. Additionally, api/main.py raises a NameError on startup due to a missing Union import, and POST /forms/fill makes a redundant database query on every request.

Fixes #204
Fixes #187
Fixes #135
Fixes #149
Fixes #145

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Tested on Windows 11, Python 3.11, clean virtual environment.

  1. Created fresh venv: python -m venv venv && venv\Scripts\activate
  2. Ran pip install -r requirements.txt — all packages install without errors
  3. Started server: uvicorn api.main:app --reload — no NameError on startup
  4. Uploaded a PDF via POST /templates/create — succeeds (previously failed with python-multipart error)
  5. Called POST /forms/fill — single DB query confirmed in SQLAlchemy logs
  • Manual end-to-end test (upload → fill → verify)
  • Existing unit tests pass locally

Test Configuration:

  • OS: Windows 11
  • Python: 3.11
  • Ollama: 0.17.7 / Mistral 7B

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

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

Labels

None yet

Projects

None yet

1 participant