chore(deps): upgrade SQLAlchemy from 1.4.41 to 2.0.45#998
Merged
canihavesomecoffee merged 2 commits intomasterfrom Jan 4, 2026
Merged
chore(deps): upgrade SQLAlchemy from 1.4.41 to 2.0.45#998canihavesomecoffee merged 2 commits intomasterfrom
canihavesomecoffee merged 2 commits intomasterfrom
Conversation
| return DeclEnumType(self.enum) | ||
|
|
||
| def process_bind_param(self, value: EnumSymbol, dialect: SQLiteDialect_pysqlite) -> str: | ||
| def process_bind_param(self, value: Optional[Any], dialect: Dialect) -> Optional[str]: |
Member
There was a problem hiding this comment.
Why change this from EnumSymbol to an Optional[Any]?
| return value.value | ||
|
|
||
| def process_result_value(self, value: str, dialect: SQLiteDialect_pysqlite) -> EnumSymbol: | ||
| def process_result_value(self, value: Optional[Any], dialect: Dialect) -> Optional[EnumSymbol]: |
Member
There was a problem hiding this comment.
Same here, why replace a str (which value should clearly be) with Any, that even can be null
b67f6a9 to
a99d38a
Compare
Contributor
Author
|
Fixed the type annotations - restored |
2 tasks
canihavesomecoffee
approved these changes
Jan 4, 2026
This PR upgrades SQLAlchemy to version 2.0.45, addressing breaking changes: - Update DeclarativeBase: Replace deprecated declarative_base() with new class-based DeclarativeBase pattern - Fix raw SQL execution: Wrap string SQL with text() in mod_health and tests - Update DeclEnumType: Use String(50) as impl instead of Enum to avoid SQLAlchemy 2.0's stricter enum value validation in TypeDecorator - Fix engine creation: Remove deprecated convert_unicode parameter and use StaticPool for SQLite in-memory databases to ensure connection sharing - Update type hints: Use generic Dialect type instead of SQLite-specific All 402 tests pass with the upgraded SQLAlchemy version. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Keep EnumSymbol and str types instead of Any for better type safety. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
d382165 to
c901650
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
This PR upgrades SQLAlchemy to version 2.0.45, addressing the breaking changes from the major version update. This is an equivalent replacement for PR #959 (Dependabot's auto-generated PR) but with the necessary code changes to make all tests pass.
Changes made:
declarative_base()with new class-basedDeclarativeBasepatterntext()inmod_health/controllers.pyandtests/base.pyString(50)as impl instead ofEnumto avoid SQLAlchemy 2.0's stricter enum value validation in TypeDecoratorconvert_unicodeparameter and useStaticPoolfor SQLite in-memory databases to ensure proper connection sharing during testsDialecttype instead of SQLite-specific dialect typesTest plan
🤖 Generated with Claude Code