Skip to content

Commit 3ba5029

Browse files
fix validation issues
1 parent 7e134cd commit 3ba5029

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/models-library/src/models_library/api_schemas_directorv2/comp_tasks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ class ComputationCreate(BaseModel):
5050
description="contains information about the wallet used to bill the running service",
5151
)
5252

53-
@field_validator("product_name", mode="before")
53+
@field_validator("product_name")
5454
@classmethod
5555
def ensure_product_name_defined_if_computation_starts(cls, v, values):
5656
if "start_pipeline" in values and values["start_pipeline"] and v is None:
5757
msg = "product_name must be set if computation shall start!"
5858
raise ValueError(msg)
5959
return v
6060

61-
@field_validator("use_on_demand_clusters", mode="before")
61+
@field_validator("use_on_demand_clusters")
6262
@classmethod
6363
def ensure_expected_options(cls, v, values):
6464
if v is True and ("cluster_id" in values and values["cluster_id"] is not None):

packages/models-library/src/models_library/api_schemas_directorv2/services.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class NodeRequirements(BaseModel):
2121
None,
2222
description="defines the required (maximum) GPU for running the services",
2323
alias="GPU",
24+
validate_default=True
2425
)
2526
ram: ByteSize = Field(
2627
...,
@@ -31,6 +32,7 @@ class NodeRequirements(BaseModel):
3132
default=None,
3233
description="defines the required (maximum) amount of VRAM for running the services",
3334
alias="VRAM",
35+
validate_default=True
3436
)
3537

3638
@field_validator("vram", "gpu", mode="before")

0 commit comments

Comments
 (0)