Skip to content

Commit

Permalink
Merge pull request #88 from kyuengmanKim/fix/python-null-bug-fix
Browse files Browse the repository at this point in the history
Update anomaly model
  • Loading branch information
kyuengmanKim authored Oct 31, 2024
2 parents 934b1aa + ba72d17 commit 7d5e825
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions python/insight/app/api/anomaly/response/res.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@ class AnomalyDetectionSettings(BaseModel):
target_type: str
measurement: str
execution_interval: str
last_execution: str = Field(..., description="The timestamp for the anomaly detection last run.",
format="date-time", example="2024-10-08T06:50:37Z")
last_execution: Optional[str] = Field(
None,
description="The timestamp for the anomaly detection last run.",
format="date-time",
example="2024-10-08T06:50:37Z"
)
create_at: str = Field(..., description="The timestamp for the registration for anomaly detection target.",
format="date-time", example="2024-10-08T06:50:37Z")

Expand Down
2 changes: 1 addition & 1 deletion python/insight/app/api/anomaly/utils/setting.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def get_all_settings(self) -> ResBodyAnomalyDetectionSettings:
target_type=setting.TARGET_TYPE,
measurement=setting.MEASUREMENT,
execution_interval=setting.EXECUTION_INTERVAL,
last_execution=setting.LAST_EXECUTION.strftime('%Y-%m-%dT%H:%M:%SZ'),
last_execution=setting.LAST_EXECUTION.strftime('%Y-%m-%dT%H:%M:%SZ') if setting.LAST_EXECUTION else None,
create_at=setting.REGDATE.strftime('%Y-%m-%dT%H:%M:%SZ')
)
for setting in settings
Expand Down

0 comments on commit 7d5e825

Please sign in to comment.