Skip to content

Commit 8c81116

Browse files
author
Natarajan Krishnaswami
committed
Fix CI errors
1 parent 3249f9b commit 8c81116

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

sqlmodel/_compat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def get_relationship_to(
153153
args = get_args(annotation)
154154
if len(args) != 2:
155155
raise ValueError(
156-
f"Dict/Mapping relationship field '{name}' has {len(args)} "
156+
f"dict relationship field '{name}' has {len(args)} "
157157
"type arguments. Exactly two required (e.g., dict[str, "
158158
"Model])"
159159
)

tests/test_attribute_keyed_dict.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import re
22
from enum import Enum
3-
from typing import Dict, Optional
3+
from typing import Optional
44

55
import pytest
66
from sqlalchemy.orm.collections import attribute_keyed_dict
@@ -24,7 +24,7 @@ class Parent(SQLModel, table=True):
2424
__tablename__ = "parents"
2525

2626
id: Optional[int] = Field(primary_key=True, default=None)
27-
children_by_color: Dict[Color, Child] = Relationship(
27+
children_by_color: dict[Color, Child] = Relationship(
2828
sa_relationship_kwargs={"collection_class": attribute_keyed_dict("color")}
2929
)
3030

@@ -60,7 +60,7 @@ class Child(SQLModel, table=True):
6060
color: Color
6161
value: int
6262

63-
error_msg_fmt = "Dict/Mapping relationship field 'children_by_color' has {count} type arguments. Exactly two required (e.g., dict[str, Model])"
63+
error_msg_fmt = "dict relationship field 'children_by_color' has {count} type arguments. Exactly two required (e.g., dict[str, Model])"
6464

6565
# One type arg
6666
with pytest.raises(ValueError, match=re.escape(error_msg_fmt.format(count=1))):

0 commit comments

Comments
 (0)