diff --git a/api/chalicelib/core/performance_event.py b/api/chalicelib/core/performance_event.py index 1311614d9..76633ce40 100644 --- a/api/chalicelib/core/performance_event.py +++ b/api/chalicelib/core/performance_event.py @@ -10,5 +10,6 @@ def get_col(perf: schemas.PerformanceEventType): "extraJoin": "events.performance"}, schemas.PerformanceEventType.fetch_failed: {"column": "success", "extraJoin": None}, # schemas.PerformanceEventType.fetch_duration: {"column": "duration", "extraJoin": None}, - # schemas.PerformanceEventType.location_largest_contentful_paint_time: "timestamp" + schemas.PerformanceEventType.location_largest_contentful_paint_time: {"column": "first_contentful_paint_time", + "extraJoin": None} }.get(perf) diff --git a/api/schemas.py b/api/schemas.py index 76b4f0ce8..fe5296e52 100644 --- a/api/schemas.py +++ b/api/schemas.py @@ -442,7 +442,7 @@ class IssueType(str, Enum): class _SessionSearchEventRaw(BaseModel): - custom: Optional[List[Union[int, str]]] = Field(None) + custom: Optional[List[Union[int, str]]] = Field(None, min_items=1) customOperator: Optional[MathOperator] = Field(None) key: Optional[str] = Field(None) value: Union[str, List[str]] = Field(...) @@ -455,9 +455,9 @@ class _SessionSearchEventRaw(BaseModel): if isinstance(values.get("type"), PerformanceEventType): if values.get("type") == PerformanceEventType.fetch_failed: return values - assert values.get("custom") is not None, "custom should not be None for PerformanceEventType" + assert values.get("custom") is not None, "custom should not be null for PerformanceEventType" assert values.get("customOperator") is not None \ - , "customOperator should not be None for PerformanceEventType" + , "customOperator should not be null for PerformanceEventType" if values["type"] == PerformanceEventType.time_between_events: assert len(values.get("value", [])) == 2, \ f"must provide 2 Events as value for {PerformanceEventType.time_between_events}"