8
8
its results into a specific table.
9
9
"""
10
10
11
+ import sys
12
+
11
13
from datetime import datetime
12
14
from typing import List , Optional
13
15
@@ -46,7 +48,8 @@ class Run(SQLModel, table=True): # type: ignore[call-arg]
46
48
# Ignore clash of `model_id` field name with default protected namespace `model_`
47
49
# See: https://github.com/pydantic/pydantic/discussions/7121
48
50
# Better solution using `alias` is not possible due to SQLModel issue
49
- model_config = ConfigDict (protected_namespaces = ())
51
+ if sys .version_info >= (3 , 8 ):
52
+ model_config = ConfigDict (protected_namespaces = ()) # type: ignore
50
53
51
54
#: Foreign key in all ``metric`` tables
52
55
id : Optional [int ] = Field (default = None , primary_key = True )
@@ -70,7 +73,8 @@ class Metric(SQLModel):
70
73
# Ignore clash of `model_id` field name with default protected namespace `model_`
71
74
# See: https://github.com/pydantic/pydantic/discussions/7121
72
75
# Better solution using `alias` is not possible due to SQLModel issue
73
- model_config = ConfigDict (protected_namespaces = ())
76
+ if sys .version_info >= (3 , 8 ):
77
+ model_config = ConfigDict (protected_namespaces = ()) # type: ignore
74
78
75
79
#: The technical identifier for this database row
76
80
id : Optional [int ] = Field (default = None , primary_key = True )
0 commit comments