Skip to content

fix(trace-attrs): Assert organization_id is not None before ORM filter#107741

Merged
JoshFerge merged 1 commit intomasterfrom
jferg/fix-trace-attrs-none-guard
Feb 6, 2026
Merged

fix(trace-attrs): Assert organization_id is not None before ORM filter#107741
JoshFerge merged 1 commit intomasterfrom
jferg/fix-trace-attrs-none-guard

Conversation

@JoshFerge
Copy link
Member

Summary

Found during mypy / django-stubs upgrade in #107710.

Adds assert self.snuba_params.organization_id is not None before two Release.objects.filter(organization_id=...) calls in semver_package_autocomplete_function(), where organization_id is typed as int | None.

Test plan

  • Pre-commit hooks pass

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Feb 5, 2026
]

def semver_package_autocomplete_function(self):
assert self.snuba_params.organization_id is not None
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similar assertions in other functions in this file, eg line :604

@JoshFerge JoshFerge marked this pull request as ready for review February 6, 2026 00:02
@JoshFerge JoshFerge requested a review from a team as a code owner February 6, 2026 00:02
@JoshFerge JoshFerge requested a review from a team February 6, 2026 00:02
@JoshFerge JoshFerge merged commit 620d2a8 into master Feb 6, 2026
73 checks passed
@JoshFerge JoshFerge deleted the jferg/fix-trace-attrs-none-guard branch February 6, 2026 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants