Skip to content

Commit 47e87e4

Browse files
committed
fix: jobparameters and jobattributes pydantic models
1 parent 69494d8 commit 47e87e4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

diracx-core/src/diracx/core/models.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,13 @@ class SearchParams(BaseModel):
7575
# TODO: Add more validation
7676

7777

78-
class JobParameters(BaseModel, extra="forbid"):
78+
class JobParameters(BaseModel):
7979
"""All the parameters that can be set for a job."""
8080

8181
timestamp: datetime | None = None
82-
cpu_normalization_factor: int | None = Field(None, alias="CPUNormalizationFactor")
83-
norm_cpu_time_s: int | None = Field(None, alias="NormCPUTime(s)")
84-
total_cpu_time_s: int | None = Field(None, alias="TotalCPUTime(s)")
82+
cpu_normalization_factor: float | None = Field(None, alias="CPUNormalizationFactor")
83+
norm_cpu_time_s: float | None = Field(None, alias="NormCPUTime(s)")
84+
total_cpu_time_s: float | None = Field(None, alias="TotalCPUTime(s)")
8585
host_name: str | None = Field(None, alias="HostName")
8686
grid_ce: str | None = Field(None, alias="GridCE")
8787
model_name: str | None = Field(None, alias="ModelName")
@@ -96,7 +96,7 @@ class JobParameters(BaseModel, extra="forbid"):
9696
job_status: str | None = Field(None, alias="JobStatus")
9797

9898

99-
class JobAttributes(BaseModel, extra="forbid"):
99+
class JobAttributes(BaseModel):
100100
"""All the attributes that can be set for a job."""
101101

102102
job_type: str | None = Field(None, alias="JobType")
@@ -121,7 +121,7 @@ class JobAttributes(BaseModel, extra="forbid"):
121121
accounted_flag: bool | str | None = Field(None, alias="AccountedFlag")
122122

123123

124-
class JobMetaData(JobAttributes, JobParameters, extra="forbid"):
124+
class JobMetaData(JobAttributes, JobParameters):
125125
"""A model that combines both JobAttributes and JobParameters."""
126126

127127

0 commit comments

Comments
 (0)