Skip to content

Commit 261abb2

Browse files
committed
typing fix
1 parent 8df6bc6 commit 261abb2

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/sentry/seer/similarity/config.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# - Rolled-out projects: Use this for ALL requests (both grouping and embeddings)
1717
# - Non-rolled-out projects: Never use this (use stable version for everything)
1818
# Set to None to disable rollout entirely
19-
SEER_GROUPING_NEW_VERSION = GroupingVersion.V2
19+
SEER_GROUPING_NEW_VERSION: GroupingVersion | None = GroupingVersion.V2
2020

2121
# Feature flag name (version-agnostic)
2222
SEER_GROUPING_NEW_MODEL_ROLLOUT_FEATURE = "projects:similarity-grouping-model-upgrade"
@@ -30,7 +30,12 @@ def get_grouping_model_version(project: Project) -> GroupingVersion:
3030
- New version if rollout is enabled for this project
3131
- Stable version otherwise
3232
"""
33-
if is_new_model_rolled_out(project):
33+
# Early return if no new version configured
34+
if SEER_GROUPING_NEW_VERSION is None:
35+
return SEER_GROUPING_STABLE_VERSION
36+
37+
# Type is narrowed to GroupingVersion here
38+
if features.has(SEER_GROUPING_NEW_MODEL_ROLLOUT_FEATURE, project):
3439
return SEER_GROUPING_NEW_VERSION
3540
return SEER_GROUPING_STABLE_VERSION
3641

0 commit comments

Comments
 (0)