Skip to content

fix: pin SQLAlchemy>=2.0 in requirements.txt (CORE-63)#13316

Merged
Kosinkadink merged 2 commits intoComfy-Org:masterfrom
octo-patch:fix/issue-13036-sqlalchemy-version-requirement
Apr 20, 2026
Merged

fix: pin SQLAlchemy>=2.0 in requirements.txt (CORE-63)#13316
Kosinkadink merged 2 commits intoComfy-Org:masterfrom
octo-patch:fix/issue-13036-sqlalchemy-version-requirement

Conversation

@octo-patch
Copy link
Copy Markdown
Contributor

Fixes #13036

Problem

ComfyUI uses SQLAlchemy 2.0-only APIs (DeclarativeBase, mapped_column, Mapped) in app/database/models.py and app/assets/database/models.py. Without a minimum version constraint, pip can resolve SQLAlchemy 1.x, causing an ImportError that crashes startup before any try/except can intercept it.

Solution

Pin SQLAlchemy>=2.0 in requirements.txt to ensure pip installs a compatible version.

Testing

Verified that both app/database/models.py and app/assets/database/models.py use SQLAlchemy 2.0-only APIs (DeclarativeBase, mapped_column, Mapped), and the constraint aligns with what the codebase already requires implicitly.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 7, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 721910a5-89cf-4db6-ac86-a729051757a5

📥 Commits

Reviewing files that changed from the base of the PR and between d656ca3 and de08374.

📒 Files selected for processing (1)
  • requirements.txt
✅ Files skipped from review due to trivial changes (1)
  • requirements.txt

📝 Walkthrough

Walkthrough

The pull request updates requirements.txt to change the SQLAlchemy dependency from an unconstrained entry (SQLAlchemy) to a minimum-version constraint (SQLAlchemy>=2.0). No other dependency entries or their version constraints were modified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: pinning SQLAlchemy to version 2.0 or higher in requirements.txt, with clear reference to the associated issue.
Description check ✅ Passed The description clearly explains the problem (SQLAlchemy 2.0-only APIs causing import errors), the solution (pinning SQLAlchemy>=2.0), and verification of the fix.
Linked Issues check ✅ Passed The PR successfully addresses all key objectives from issue #13036: identifying SQLAlchemy 2.0-only imports, preventing startup crashes, and ensuring users have a clear remediation path by pinning the minimum version.
Out of Scope Changes check ✅ Passed The PR only modifies requirements.txt with the SQLAlchemy version constraint, which is directly related to resolving issue #13036 and contains no unrelated changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@alexisrolland alexisrolland changed the title fix: pin SQLAlchemy>=2.0 in requirements.txt fix: pin SQLAlchemy>=2.0 in requirements.txt (CORE-63) Apr 16, 2026
@Kosinkadink Kosinkadink merged commit 543e9fb into Comfy-Org:master Apr 20, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SQLAlchemy 2.0 dependency (mapped_column, DeclarativeBase) breaks existing installs

2 participants