Skip to content

fix(typing): Fix order_by column type handling in base_query_set#107790

Draft
JoshFerge wants to merge 1 commit intomasterfrom
jferg/fix-typing-base-query-set
Draft

fix(typing): Fix order_by column type handling in base_query_set#107790
JoshFerge wants to merge 1 commit intomasterfrom
jferg/fix-typing-base-query-set

Conversation

@JoshFerge
Copy link
Member

@JoshFerge JoshFerge commented Feb 6, 2026

Summary

  • Narrow col with isinstance(col, str) before passing to query.annotations.get(), since query.order_by contains str | Combinable
  • Type new_order_by as list[str | Combinable] to properly handle both branches
  • Pre-work for mypy 1.19 upgrade

Ref: #107710

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Feb 6, 2026
Narrow `col` with `isinstance(col, str)` before passing to
`query.annotations.get()`, and type `new_order_by` as
`list[str | Combinable]` to properly handle both branches.

Ref: #107727
@JoshFerge JoshFerge force-pushed the jferg/fix-typing-base-query-set branch from 062a7fa to ff74257 Compare February 6, 2026 19:04
@JoshFerge JoshFerge changed the title fix(typing): Add type: ignore for order_by column types in base_query_set fix(typing): Fix order_by column type handling in base_query_set Feb 6, 2026
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.

1 participant