Skip to content

Commit 07c11ba

Browse files
authored
Merge branch 'main' into main
2 parents d8741bf + 793800d commit 07c11ba

4 files changed

Lines changed: 8 additions & 4 deletions

File tree

docs/release-notes.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Latest Changes
44

5+
### Refactors
6+
7+
* ♻️ Import `Literal` from the `typing` module directly. PR [#1699](https://github.com/fastapi/sqlmodel/pull/1699) by [@svlandeg](https://github.com/svlandeg).
8+
59
### Docs
610

711
* 📝 Remove duplicated word in `read-relationships.md`. PR [#1705](https://github.com/fastapi/sqlmodel/pull/1705) by [@stefmolin](https://github.com/stefmolin).

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,
@@ -49,7 +50,7 @@
4950
from sqlalchemy.sql.schema import MetaData, SchemaEventTarget
5051
from sqlalchemy.sql.sqltypes import LargeBinary, Time, Uuid
5152
from sqlalchemy.types import TypeEngine
52-
from typing_extensions import Literal, TypeAlias, deprecated, get_origin
53+
from typing_extensions import TypeAlias, deprecated, get_origin
5354

5455
from ._compat import ( # type: ignore[attr-defined]
5556
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)