Skip to content

Commit 4732119

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

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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)