fix(chalice): heatmap handles empty/null url (#2691)

This commit is contained in:
Kraiem Taha Yassine 2024-10-28 12:08:17 +01:00 committed by GitHub
parent b353c818c3
commit e2556ea76e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 1 deletions

View file

@ -9,6 +9,8 @@ logger = logging.getLogger(__name__)
def get_by_url(project_id, data: schemas.GetHeatMapPayloadSchema):
if data.url is None or data.url == "":
return []
args = {"startDate": data.startTimestamp, "endDate": data.endTimestamp,
"project_id": project_id, "url": data.url}
constraints = ["sessions.project_id = %(project_id)s",

View file

@ -1595,7 +1595,7 @@ class HeatMapFilterSchema(BaseModel):
class GetHeatMapPayloadSchema(_TimedSchema):
url: str = Field(...)
url: Optional[str] = Field(...)
filters: List[HeatMapFilterSchema] = Field(default=[])
click_rage: bool = Field(default=False)

View file

@ -17,6 +17,8 @@ logger = logging.getLogger(__name__)
def get_by_url(project_id, data: schemas.GetHeatMapPayloadSchema):
if data.url is None or data.url == "":
return []
args = {"startDate": data.startTimestamp, "endDate": data.endTimestamp,
"project_id": project_id, "url": data.url}
constraints = ["main_events.project_id = toUInt16(%(project_id)s)",