Skip to content

Pinning SQLAlchemy to 2.0.x - #63

Merged
tonyskapunk merged 1 commit into
mainfrom
sqlalchemy_pinning
Sep 28, 2026
Merged

tonyskapunk merged 1 commit into
mainfrom
sqlalchemy_pinning

Conversation

@tonyskapunk

@tonyskapunk tonyskapunk commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

SQLAlchemy-Utils does not have support for SQLAlchemy v2.1 yet
causing issues while importing
kvesteri/sqlalchemy-utils#829
kvesteri/sqlalchemy-utils#800
Should be solved by: kvesteri/sqlalchemy-utils#831

    SQLAlchemy on 2.1 is causing this issue during db init:
    Traceback (most recent call last):
      File "/opt/dci-control-server/bin/dci-dbinit", line 27, in <module>
        from sqlalchemy_utils import functions as sa_funcs
      File "/usr/local/lib/python3.12/site-packages/sqlalchemy_utils/__init__.py", line 46, in <module>
        from .generic import generic_relationship  # noqa
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.12/site-packages/sqlalchemy_utils/generic.py", line 15, in <module>
        class GenericAttributeImpl(attributes.ScalarAttributeImpl):
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    AttributeError: module 'sqlalchemy.orm.attributes' has no attribute 'ScalarAttributeImpl'. Did you mean: '_ScalarAttributeImpl'?
    Unable to init the DB. Exiting.

Summary by CodeRabbit

  • Chores
    • No user-facing features, fixes, or behavior changes are included in this release. The update is limited to internal maintenance and does not change how the product looks or works.

@tonyskapunk tonyskapunk self-assigned this Sep 26, 2026
@coderabbitai

coderabbitai Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 3ab647ac-ea99-444a-8d61-bcc6c97d468a

📥 Commits

Reviewing files that changed from the base of the PR and between 7e75a52 and b891a3e.

📒 Files selected for processing (1)
  • requirements.txt

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The SQLAlchemy requirement now specifies versions 2.0.0 or later and below 2.1.0.

Changes

SQLAlchemy Requirement

Layer / File(s) Summary
Set SQLAlchemy version range
requirements.txt
The SQLAlchemy dependency now has the constraint >=2.0.0,<2.1.0.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to b891a

SQLAlchemy is constrained to the 2.0.x range, matching the reported initialization incompatibility with 2.1; no actionable merge risk is evident from the supplied change.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: restricting SQLAlchemy to the 2.0.x version range to prevent the reported database initialization failure.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

@fcharlier

Copy link
Copy Markdown
Contributor

@tonyskapunk thanks for this fix, it's most likely a problem with sqlalchemy-utils.
Cf.:

Could you add references to these 3 issues in your commit message and a quick comment in the requirements.txt file so that we can track their evolution and upgrade to SQLAlchemy 2.1 later ?

@fcharlier fcharlier left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please track the reason for pinning as a comment in this file

SQLAlchemy-Utils does not have support for SQLAlchemy v2.1 yet
causing issues while importing
kvesteri/sqlalchemy-utils#829
kvesteri/sqlalchemy-utils#800
Should be solved by: kvesteri/sqlalchemy-utils#831

SQLAlchemy on 2.1 is causing this issue during db init:
Traceback (most recent call last):
  File "/opt/dci-control-server/bin/dci-dbinit", line 27, in <module>
    from sqlalchemy_utils import functions as sa_funcs
  File "/usr/local/lib/python3.12/site-packages/sqlalchemy_utils/__init__.py", line 46, in <module>
    from .generic import generic_relationship  # noqa
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/sqlalchemy_utils/generic.py", line 15, in <module>
    class GenericAttributeImpl(attributes.ScalarAttributeImpl):
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'sqlalchemy.orm.attributes' has no attribute 'ScalarAttributeImpl'. Did you mean: '_ScalarAttributeImpl'?
Unable to init the DB. Exiting.
@fcharlier

Copy link
Copy Markdown
Contributor

recheck

@tonyskapunk
tonyskapunk merged commit 48a23bb into main Sep 28, 2026
2 checks passed
@tonyskapunk
tonyskapunk deleted the sqlalchemy_pinning branch September 28, 2026 15:31
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.

2 participants