FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

♻️ Import `Literal` from the `typing` module directly by svlandeg · Pull Request #1699 · fastapi/sqlmodel · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (3) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
3 changes: 2 additions & 1 deletion sqlmodel/main.py
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
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
Any,
Callable,
ClassVar,
Literal,
Optional,
TypeVar,
Union,
Expand Down Expand Up @@ -48,7 +49,7 @@
from sqlalchemy.orm.instrumentation import is_instrumented
from sqlalchemy.sql.schema import MetaData
from sqlalchemy.sql.sqltypes import LargeBinary, Time, Uuid
from typing_extensions import Literal, TypeAlias, deprecated, get_origin
from typing_extensions import TypeAlias, deprecated, get_origin

from ._compat import ( # type: ignore[attr-defined]
IS_PYDANTIC_V2,
Expand Down
2 changes: 1 addition & 1 deletion sqlmodel/sql/expression.py
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from collections.abc import Iterable, Mapping, Sequence
from typing import (
Any,
Literal,
Optional,
TypeVar,
Union,
Expand Down Expand Up @@ -34,7 +35,6 @@
UnaryExpression,
)
from sqlalchemy.sql.type_api import TypeEngine
from typing_extensions import Literal

from ._expression_select_cls import Select as Select
from ._expression_select_cls import SelectOfScalar as SelectOfScalar
Expand Down
3 changes: 1 addition & 2 deletions tests/test_pydantic/test_field.py
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
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
from decimal import Decimal
from typing import Optional, Union
from typing import Literal, Optional, Union

import pytest
from pydantic import ValidationError
from sqlmodel import Field, SQLModel
from typing_extensions import Literal


def test_decimal():
Expand Down
Loading

Back | FazBrowse Home | New Git URL