Skip to content

Conversation

@JoshFerge
Copy link
Member

Summary

Add isinstance check for col before accessing query.annotations.get() and add explicit type annotation for new_order_by list to handle mixed types (str, Combinable, Expression).

Changes

  • Add isinstance(col, str) check before dictionary access
  • Add explicit list[Any] type annotation for new_order_by
  • Handle both string and Combinable types in order_by processing

Test plan

  • Existing tests pass
  • Mypy type checking passes

Add isinstance check for col before accessing query.annotations.get() and
add explicit type annotation for new_order_by list to handle mixed types
(str, Combinable, Expression).
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 10, 2025
@codecov
Copy link

codecov bot commented Nov 10, 2025

Codecov Report

❌ Patch coverage is 12.50000% with 7 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/sentry/db/models/manager/base_query_set.py 12.50% 7 Missing ⚠️

❌ Your patch check has failed because the patch coverage (12.50%) is below the target coverage (50.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #103016      +/-   ##
===========================================
- Coverage   80.75%    80.64%   -0.12%     
===========================================
  Files        9145      9140       -5     
  Lines      395020    392796    -2224     
  Branches    24968     24968              
===========================================
- Hits       319002    316768    -2234     
- Misses      75617     75627      +10     
  Partials      401       401              

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