Skip to content

Commit

Permalink
Merge branch 'main' into feat-1770-add-time-frame
Browse files Browse the repository at this point in the history
  • Loading branch information
rajesh-jonnalagadda authored Sep 25, 2024
2 parents 74dec1c + cc36a28 commit 7483359
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions keep/api/models/db/mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ class MappingRuleDtoOut(MappRuleDtoBase, extra="ignore"):
class MappingRuleDtoIn(MappRuleDtoBase):
rows: Optional[list[dict]] = None

@validator("type", pre=True, always=True)
def validate_type(cls, _type, values):
if _type == "csv" and not values.get("rows"):
@validator("rows", pre=True, always=True)
def validate_rows(cls, rows, values):
if not rows and values.get("type") == "csv":
raise ValueError("Mapping of type CSV cannot have empty rows")
return _type
return rows
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "keep"
version = "0.24.5"
version = "0.25.0"
description = "Alerting. for developers, by developers."
authors = ["Keep Alerting LTD"]
readme = "README.md"
Expand Down

0 comments on commit 7483359

Please sign in to comment.