Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Upgrade SQLAlchemy to 2.0, including initial work by farahats9 #700

Merged
merged 43 commits into from
Nov 18, 2023
Merged
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
60318b4
migration to sqlalchemy 2.0
farahats9 Mar 7, 2023
48ddc61
fix some linting errors
farahats9 Mar 24, 2023
b48423f
remove unused imports
farahats9 Mar 24, 2023
9c219d9
Update sqlmodel/sql/expression.py
farahats9 Mar 31, 2023
37ed979
reflecting python 3.6 deprecation in docs and tests
farahats9 Mar 31, 2023
0eee8e8
Merge branch 'main' of https://github.com/farahats9/sqlmodel
farahats9 Mar 31, 2023
050cf02
resolving @sbor23 comments
farahats9 Mar 31, 2023
fbff99c
add the new Subquery class
farahats9 Apr 30, 2023
6d8f527
update to latest sqlalchemy version
farahats9 Apr 30, 2023
4ce8d07
fix jinja2 template
farahats9 Apr 30, 2023
ecfb321
`Result` expects a type `Tuple[_T]`
peterlandry Jul 26, 2023
3738a7f
Remove unused type ignore
peterlandry Jul 26, 2023
814988b
Result seems well enough typed in SqlAlchemy now we can simply shim over
peterlandry Jul 26, 2023
118ca33
Implicit export of ForwardRef was remove in pydantic
peterlandry Jul 26, 2023
9170729
_Select expects a `Tuple[Any, ...]`
peterlandry Jul 26, 2023
7f5ba1c
Use Dict type instead of Mapping for SqlAlchemy compat
peterlandry Jul 26, 2023
e942e5e
Execution options are not Optional in SA
peterlandry Jul 26, 2023
ef9f00a
Another instance of non-optional execution_options
peterlandry Jul 26, 2023
643cea5
Fix Tuple in jinja template as well
peterlandry Jul 26, 2023
b89adbb
Use ForUpdateArg from sqlalchemy
peterlandry Jul 26, 2023
eff0803
Fix signature for `Session.get`
peterlandry Jul 26, 2023
c5bdbcc
Merge pull request #2 from peterlandry/main
farahats9 Jul 27, 2023
1752f0b
formatting and remove unused type
farahats9 Jul 27, 2023
b4f4a4f
🔀 Merge branch 'main' into sa2-a
tiangolo Nov 7, 2023
4d264a3
📝 Do not claim Python 3.11 yet, this will be done in a subsequent PR
tiangolo Nov 7, 2023
5f52693
🔥 Remove no longer necessary engine module, it was only to provide ty…
tiangolo Nov 7, 2023
0468d6f
⏪️ Revert altering tutorial, avoiding lack of support for forward ref…
tiangolo Nov 17, 2023
fcb92a0
🐛 Fix support for forward references in relationships
tiangolo Nov 17, 2023
f02584b
✅ Update tests for newest FastAPI with OpenAPI 3.1.0
tiangolo Nov 17, 2023
f4127d2
⏪️ Revert altering tutorial to accomodate for the previous lack of su…
tiangolo Nov 17, 2023
50cb798
✨ Update and refactor expression (and template) with new types from S…
tiangolo Nov 17, 2023
2083ba6
🎨 Update type annotation in sqltypes.py
tiangolo Nov 17, 2023
8672bfa
♻️ Refactor generation of expression.py with template
tiangolo Nov 17, 2023
b433b7d
✨ Update Session types and logic, add deprecations for discouraged me…
tiangolo Nov 17, 2023
4ada203
✨ Update import and export locations
tiangolo Nov 17, 2023
aa27b2b
🔧 Update mypy config for docs_src
tiangolo Nov 17, 2023
baa5e3a
⬆️ Update SQLAlchemy dependency pin
tiangolo Nov 17, 2023
80a5c52
✨ Update AsyncSession with support for SQLAlchemy 2.0 and new Session
tiangolo Nov 17, 2023
61f6a1f
✨ Add some new re-exported objects from SQLAlchemy
tiangolo Nov 18, 2023
7e9971d
♻️ Update type annotations of expression.py to support old Pythons
tiangolo Nov 18, 2023
62327ce
⬆️ Upgrade FastAPI and HTTPX dependency for tests
tiangolo Nov 18, 2023
40beca9
Merge branch 'main' into sa2-a
tiangolo Nov 18, 2023
be5277e
🔇 Do not run mypy on Python 3.7 as it behaves differently
tiangolo Nov 18, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
🎨 Update type annotation in sqltypes.py
  • Loading branch information
tiangolo committed Nov 17, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 2083ba6d38f2a5d36f71d3e700a7413430666987
2 changes: 1 addition & 1 deletion sqlmodel/sql/sqltypes.py
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ class GUID(types.TypeDecorator): # type: ignore
impl = CHAR
cache_ok = True

def load_dialect_impl(self, dialect: Dialect) -> TypeEngine: # type: ignore
def load_dialect_impl(self, dialect: Dialect) -> TypeEngine[Any]:
if dialect.name == "postgresql":
return dialect.type_descriptor(UUID())
else: