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
Running the application via the make exec command crashes immediately upon startup with a NameError: name 'Union' is not defined. This occurs because Union is used for type hinting the pdf_form_path parameter in the run_pdf_fill_process function signature in src/main.py, but the module is never imported.
👣 Steps to Reproduce
Ensure the Docker containers are running (docker compose up -d).
Run the command make exec (or docker compose exec app python3 src/main.py) in the terminal.
See the NameError crash output immediately.
📉 Expected Behavior
The application should start successfully, detect the PDF, and begin the extraction/filling process without throwing Python standard library import errors.
🖥️ Environment Information
OS: Windows / WSL 2 (Ubuntu)
Docker/Compose Version: Docker Desktop latest
Ollama Model used: Mistral
📸 Screenshots/Logs
Traceback (most recent call last):
File "/app/src/main.py", line 14, in <module>
def run_pdf_fill_process(user_input: str, definitions: list, pdf_form_path: Union[str, os.PathLike]):
^^^^^
NameError: name 'Union' is not defined
🕵️ Possible Fix
Add the missing import statement from the standard typing library at the top of src/main.py:
Hi! I've submitted PR #407 which fixes this NameError by adding the missing Union import. The PR also includes a new feature for mapping PDF checkboxes and radio buttons. Ready for review!
In the current /main branch there's no use of Union, in fact is a bad practice. Starting with Python 3.10 (PEP 604), you should use the pipe operator (|) instead of typing.Union for type hints.
Old way: typing.Union[int, str]
New way: int | str
Activity
Dotify71 commentedon May 15, 2026
Hi! I've submitted PR #407 which fixes this NameError by adding the missing Union import. The PR also includes a new feature for mapping PDF checkboxes and radio buttons. Ready for review!
marcvergees commentedon May 15, 2026
In the current /main branch there's no use of Union, in fact is a bad practice. Starting with Python 3.10 (PEP 604), you should use the pipe operator (|) instead of typing.Union for type hints.
Old way: typing.Union[int, str]
New way: int | str