Skip to content

Commit ac232b1

Browse files
committed
fix(issues): Fix mypy error in issue.id shortcut
Use explicit isinstance checks instead of to_list to satisfy mypy's type narrowing for SearchValue.raw_value.
1 parent cb65dae commit ac232b1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/sentry/issues/endpoints/organization_group_index.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
from sentry.models.organization import Organization
6464
from sentry.models.project import Project
6565
from sentry.search.events.constants import EQUALITY_OPERATORS
66-
from sentry.search.events.filter import to_list
6766
from sentry.search.snuba.backend import assigned_or_suggested_filter
6867
from sentry.search.snuba.executors import get_search_filter
6968
from sentry.utils.cursors import Cursor, CursorResult
@@ -178,8 +177,11 @@ def _get_issue_id_shortcut_ids(
178177
return None
179178
if sf.key.name != "issue.id" or sf.operator not in EQUALITY_OPERATORS:
180179
return None
180+
raw = sf.value.raw_value
181181
try:
182-
return [int(v) for v in to_list(sf.value.raw_value)]
182+
if isinstance(raw, (list, tuple)):
183+
return [int(v) for v in raw]
184+
return [int(raw)]
183185
except (ValueError, TypeError):
184186
return None
185187

0 commit comments

Comments
 (0)