:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(data-quality): return 404 for non-uuid check ids (#130031)
Thiago Salvatorea48cb3b75caa
diff --git a/products/data_quality/backend/presentation/views.py b/products/data_quality/backend/presentation/views.pyindex 3a135d9b0af4..2175197e39f6 100644--- a/products/data_quality/backend/presentation/views.py+++ b/products/data_quality/backend/presentation/views.py@@ -15,12 +15,12 @@ from typing import TYPE_CHECKING, Any, ClassVar, castfrom uuid import UUIDfrom django.db.models import QuerySet-from django.shortcuts import get_object_or_404from drf_spectacular.types import OpenApiTypesfrom drf_spectacular.utils import OpenApiParameter, extend_schema, extend_schema_viewfrom rest_framework import mixins, status, viewsetsfrom rest_framework.exceptions import APIException, NotFound, PermissionDenied, ValidationError+from rest_framework.generics import get_object_or_404from rest_framework.permissions import SAFE_METHODS, BasePermission, IsAuthenticatedfrom rest_framework.request import Requestfrom rest_framework.response import Responsediff --git a/products/data_quality/backend/tests/test_api.py b/products/data_quality/backend/tests/test_api.pyindex acab28085ad6..8ae6474f33af 100644--- a/products/data_quality/backend/tests/test_api.py+++ b/products/data_quality/backend/tests/test_api.py@@ -579,6 +579,11 @@ class TestDataQualityCheckAPI(APIBaseTest):self.suites_url = f"/api/projects/{self.team.id}/data_quality_runs"self.subject = {"subject_type": SubjectType.VIEW, "subject_uuid": str(self.view.id)}+ def test_non_uuid_check_id_returns_404(self) -> None:+ response = self.client.get(f"{self.url}/999999999/runs/")++ assert response.status_code == status.HTTP_404_NOT_FOUND+def test_model_history_includes_deleted_checks_without_other_models(self) -> None:check = self._create_check()other_view = DataWarehouseSavedQuery.objects.create(