Skip to content

Commit d5cf058

Browse files
authored
Merge pull request #1528 from Giskard-AI/fix-gsk-1888-code-for-callable-functions-becomes-null
Remove auto-created `version` from mandatory fields
2 parents 7e6318b + b232786 commit d5cf058

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

giskard/ml_worker/websocket/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ class TestFunctionArgument(BaseModel):
3333

3434

3535
# CallableMeta shows that all fields can be none,
36-
# but we have a pre-check here for Database constraints:
36+
# but we have a pre-check here for Database constraints except auto-created "version":
3737
# referring to `ai.giskard.domain.Callable` and `ai.giskard.domain.TestFunction`.
3838
class FunctionMeta(BaseModel):
3939
uuid: str
4040
name: str
4141
displayName: Optional[str] = None
42-
version: int
42+
version: Optional[int] = None
4343
module: Optional[str] = None
4444
doc: Optional[str] = None
4545
moduleDoc: Optional[str] = None
@@ -51,14 +51,14 @@ class FunctionMeta(BaseModel):
5151

5252

5353
# CallableMeta shows that all fields can be none,
54-
# but we have a pre-check here for Database constraints:
54+
# but we have a pre-check here for Database constraints except auto-created "version":
5555
# referring to `ai.giskard.domain.Callable`, `ai.giskard.domain.SlicingFunction`,
5656
# `ai.giskard.domain.TransformationFunction` and `ai.giskard.domain.DatasetProcessFunction`.
5757
class DatasetProcessFunctionMeta(BaseModel):
5858
uuid: str
5959
name: str
6060
displayName: Optional[str] = None
61-
version: int
61+
version: Optional[int] = None
6262
module: Optional[str] = None
6363
doc: Optional[str] = None
6464
moduleDoc: Optional[str] = None

tests/communications/test_dto_serialization.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"DataFrame": ["rows"],
2626
"DataRow": ["columns"],
2727
"DatasetMeta": [],
28-
"DatasetProcessFunctionMeta": ["uuid", "name", "code", "version", "cellLevel"],
28+
"DatasetProcessFunctionMeta": ["uuid", "name", "code", "cellLevel"],
2929
"DatasetProcessing": ["datasetId", "totalRows"],
3030
"DatasetProcessingFunction": [],
3131
"DatasetProcessingParam": ["dataset"],
@@ -39,7 +39,7 @@
3939
"ExplainTextParam": ["model", "feature_name", "columns", "column_types"],
4040
"Explanation": ["per_feature"],
4141
"FuncArgument": ["name", "none"],
42-
"FunctionMeta": ["uuid", "name", "code", "version"],
42+
"FunctionMeta": ["uuid", "name", "code"],
4343
"GenerateTestSuite": [],
4444
"GenerateTestSuiteParam": ["project_key"],
4545
"GeneratedTestInput": ["name", "value", "is_alias"],
@@ -89,6 +89,7 @@
8989
"DataRow": [],
9090
"DatasetMeta": ["target"],
9191
"DatasetProcessFunctionMeta": [
92+
"version",
9293
"displayName",
9394
"module",
9495
"doc",
@@ -124,6 +125,7 @@
124125
"args",
125126
],
126127
"FunctionMeta": [
128+
"version",
127129
"displayName",
128130
"module",
129131
"doc",

0 commit comments

Comments
 (0)