Skip to content

Commit 82be38f

Browse files
committed
fix(typing): Use cast for get_field return type in test_hybrid_cloud
Use `cast(HybridCloudForeignKey[int, int], ...)` instead of `type: ignore[return-value]` for proper type narrowing. Ref: #107727
1 parent abcaf47 commit 82be38f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tests/sentry/deletions/tasks/test_hybrid_cloud.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from collections.abc import Callable, Generator
44
from operator import itemgetter
5-
from typing import Any, ContextManager, NotRequired, TypedDict
5+
from typing import Any, ContextManager, NotRequired, TypedDict, cast
66
from unittest.mock import patch
77

88
import pytest
@@ -92,7 +92,7 @@ def reset_watermarks() -> None:
9292

9393
@pytest.fixture
9494
def saved_search_owner_id_field() -> HybridCloudForeignKey[int, int]:
95-
return SavedSearch._meta.get_field("owner_id")
95+
return cast(HybridCloudForeignKey[int, int], SavedSearch._meta.get_field("owner_id"))
9696

9797

9898
@django_db_all

0 commit comments

Comments
 (0)