Skip to content

Commit 99d8b0b

Browse files
authored
♻️ Import Literal from the typing module directly (#1699)
import Literal from typing now that Python 3.8 is dropped
1 parent ac29fcd commit 99d8b0b

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

sqlmodel/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
Any,
1515
Callable,
1616
ClassVar,
17+
Literal,
1718
Optional,
1819
TypeVar,
1920
Union,
@@ -48,7 +49,7 @@
4849
from sqlalchemy.orm.instrumentation import is_instrumented
4950
from sqlalchemy.sql.schema import MetaData
5051
from sqlalchemy.sql.sqltypes import LargeBinary, Time, Uuid
51-
from typing_extensions import Literal, TypeAlias, deprecated, get_origin
52+
from typing_extensions import TypeAlias, deprecated, get_origin
5253

5354
from ._compat import ( # type: ignore[attr-defined]
5455
PYDANTIC_MINOR_VERSION,

sqlmodel/sql/expression.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from collections.abc import Iterable, Mapping, Sequence
22
from typing import (
33
Any,
4+
Literal,
45
Optional,
56
TypeVar,
67
Union,
@@ -34,7 +35,6 @@
3435
UnaryExpression,
3536
)
3637
from sqlalchemy.sql.type_api import TypeEngine
37-
from typing_extensions import Literal
3838

3939
from ._expression_select_cls import Select as Select
4040
from ._expression_select_cls import SelectOfScalar as SelectOfScalar

tests/test_pydantic/test_field.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
from decimal import Decimal
2-
from typing import Optional, Union
2+
from typing import Literal, Optional, Union
33

44
import pytest
55
from pydantic import ValidationError
66
from sqlmodel import Field, SQLModel
7-
from typing_extensions import Literal
87

98

109
def test_decimal():

0 commit comments

Comments
 (0)