Skip to content

Commit

Permalink
handle cases for optional fields (#955)
Browse files Browse the repository at this point in the history
  • Loading branch information
RoiGlinik authored Jun 28, 2023
1 parent 2a09e78 commit a68a593
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/robusta/core/reporting/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,13 +443,13 @@ def grade(self):


class EventRow(BaseModel):
type: str
reason: str
message: str
type: Optional[str]
reason: Optional[str]
message: Optional[str]
kind: str
name: str
namespace: str
time: str
time: Optional[str]


class EventsBlock(TableBlock):
Expand Down
2 changes: 1 addition & 1 deletion src/robusta/core/sinks/robusta/dal/supabase_dal.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ def publish_cluster_nodes(self, node_count: int):
def persist_events_block(self, block: EventsBlock):
db_events = []
for event in block.events:
row = event.dict()
row = event.dict(exclude_none=True)
row["account_id"] = self.account_id
row["cluster_id"] = self.cluster
db_events.append(row)
Expand Down

0 comments on commit a68a593

Please sign in to comment.