Skip to content

Commit 9673d53

Browse files
committed
update sqlmodel to 0.0.27 and remove compat hacks
1 parent 783b76c commit 9673d53

File tree

3 files changed

+5
-32
lines changed

3 files changed

+5
-32
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ dependencies = [
3333
"redis >=5.2.1,<7.0",
3434
"reflex-hosting-cli >=0.1.55",
3535
"rich >=13,<15",
36-
"sqlmodel >=0.0.24,<0.1",
36+
"sqlmodel >=0.0.27,<0.1",
3737
"starlette >=0.47.0",
3838
"typing_extensions >=4.13.0",
3939
"wrapt >=1.17.0,<2.0",

reflex/utils/compat.py

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -92,30 +92,3 @@ def sqlmodel_field_has_primary_key(field_info: "FieldInfo") -> bool:
9292
if getattr(field_info, "sa_column", None) is None:
9393
return False
9494
return bool(getattr(field_info.sa_column, "primary_key", None)) # pyright: ignore[reportAttributeAccessIssue]
95-
96-
97-
def sqlmodel_get_annotations(class_dict: dict[str, Any]) -> dict[str, Any]:
98-
"""Python3.14 compatible implementation of get_annotations for sqlmodel models.
99-
100-
See https://github.com/fastapi/sqlmodel/discussions/1594
101-
102-
Args:
103-
class_dict: The class dictionary.
104-
105-
Returns:
106-
The resolved annotations.
107-
"""
108-
from reflex.utils.types import resolve_annotations
109-
110-
return resolve_annotations( # type: ignore[no-any-return]
111-
annotations_from_namespace(class_dict),
112-
class_dict.get("__module__"),
113-
)
114-
115-
116-
if find_spec("sqlmodel"):
117-
# Ensure sqlmodel uses our get_annotations implementation.
118-
import sqlmodel.main
119-
120-
if sqlmodel.main.get_annotations != sqlmodel_get_annotations: # pyright: ignore[reportPrivateImportUsage]
121-
sqlmodel.main.get_annotations = sqlmodel_get_annotations # pyright: ignore[reportPrivateImportUsage]

uv.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)