File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 11
11
from datetime import datetime
12
12
from typing import List , Optional
13
13
14
+ from pydantic import ConfigDict
14
15
from sqlmodel import Field , Relationship , SQLModel
15
16
16
17
@@ -42,6 +43,11 @@ class Run(SQLModel, table=True): # type: ignore[call-arg]
42
43
Stored in the ``run`` table.
43
44
"""
44
45
46
+ # Ignore clash of `model_id` field name with default protected namespace `model_`
47
+ # See: https://github.com/pydantic/pydantic/discussions/7121
48
+ # Better solution using `alias` is not possible due to SQLModel issue
49
+ model_config = ConfigDict (protected_namespaces = ())
50
+
45
51
#: Foreign key in all ``metric`` tables
46
52
id : Optional [int ] = Field (default = None , primary_key = True )
47
53
@@ -61,6 +67,11 @@ class Metric(SQLModel):
61
67
Base ``Metric`` definition.
62
68
"""
63
69
70
+ # Ignore clash of `model_id` field name with default protected namespace `model_`
71
+ # See: https://github.com/pydantic/pydantic/discussions/7121
72
+ # Better solution using `alias` is not possible due to SQLModel issue
73
+ model_config = ConfigDict (protected_namespaces = ())
74
+
64
75
#: The technical identifier for this database row
65
76
id : Optional [int ] = Field (default = None , primary_key = True )
66
77
You can’t perform that action at this time.
0 commit comments