Skip to content

Commit e427ccf

Browse files
committed
🎨 Upgrade expression_select syntax to Python 3.10
1 parent aa4938a commit e427ccf

2 files changed

Lines changed: 4 additions & 14 deletions

File tree

sqlmodel/sql/_expression_select_gen.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from typing import (
66
Any,
77
TypeVar,
8-
Union,
98
overload,
109
)
1110
from uuid import UUID
@@ -23,11 +22,7 @@
2322
_T = TypeVar("_T")
2423

2524

26-
_TCCA = Union[
27-
TypedColumnsClauseRole[_T],
28-
SQLCoreOperations[_T],
29-
type[_T],
30-
]
25+
_TCCA = TypedColumnsClauseRole[_T] | SQLCoreOperations[_T] | type[_T]
3126

3227
# Generated TypeVars start
3328

@@ -358,7 +353,7 @@ def select( # type: ignore
358353
# Generated overloads end
359354

360355

361-
def select(*entities: Any) -> Union[Select, SelectOfScalar]: # type: ignore
356+
def select(*entities: Any) -> Select | SelectOfScalar: # type: ignore
362357
if len(entities) == 1:
363358
return SelectOfScalar(*entities)
364359
return Select(*entities)

sqlmodel/sql/_expression_select_gen.py.jinja2

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ from datetime import datetime
33
from typing import (
44
Any,
55
TypeVar,
6-
Union,
76
overload,
87
)
98
from uuid import UUID
@@ -21,11 +20,7 @@ from ._expression_select_cls import Select, SelectOfScalar
2120
_T = TypeVar("_T")
2221

2322

24-
_TCCA = Union[
25-
TypedColumnsClauseRole[_T],
26-
SQLCoreOperations[_T],
27-
type[_T],
28-
]
23+
_TCCA = TypedColumnsClauseRole[_T] | SQLCoreOperations[_T] | type[_T]
2924

3025
# Generated TypeVars start
3126

@@ -75,7 +70,7 @@ def select( # type: ignore
7570
# Generated overloads end
7671

7772

78-
def select(*entities: Any) -> Union[Select, SelectOfScalar]: # type: ignore
73+
def select(*entities: Any) -> Select | SelectOfScalar: # type: ignore
7974
if len(entities) == 1:
8075
return SelectOfScalar(*entities)
8176
return Select(*entities)

0 commit comments

Comments
 (0)