From 309d3329e34d55c5bc2d5d2890bd59b37a142ce3 Mon Sep 17 00:00:00 2001 From: Josh Ferge Date: Sun, 9 Nov 2025 23:38:44 -0500 Subject: [PATCH] fix(types): Add cast for HybridCloudForeignKey in test fixture Add isinstance check and cast to narrow the generic type parameters for HybridCloudForeignKey fixture return type. --- tests/sentry/deletions/tasks/test_hybrid_cloud.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/sentry/deletions/tasks/test_hybrid_cloud.py b/tests/sentry/deletions/tasks/test_hybrid_cloud.py index 4ef6fc50419062..2038d9b962bb22 100644 --- a/tests/sentry/deletions/tasks/test_hybrid_cloud.py +++ b/tests/sentry/deletions/tasks/test_hybrid_cloud.py @@ -92,7 +92,11 @@ def reset_watermarks() -> None: @pytest.fixture def saved_search_owner_id_field() -> HybridCloudForeignKey[int, int]: - return SavedSearch._meta.get_field("owner_id") + from typing import cast + + field = SavedSearch._meta.get_field("owner_id") + assert isinstance(field, HybridCloudForeignKey) + return cast(HybridCloudForeignKey[int, int], field) @django_db_all