Repository navigation
release: py-1.13.6 — nplusone sliced and nested loops - #171
Conversation
- nplusone reports loops over sliced querysets (#167) and now also unwraps a slice of a slice (qs[:50][:10]). - Nested loops inherit the outer queryset's eager loading and suggest the full relation path such as product__category (#168). - Agent skill 1.2.0: Playbook D says which release links inner loops to an outer prefetch, and keeps the manual checks for older releases. - Tests import unittest.mock directly (CodeQL py/import-and-import-from).
|
Caution Review failedThe pull request is closed. Walkthrough
Merge Risk:
|
Summary
Python-only release (no extension changes).
nplusonereports loops over sliced querysets — fix(nplusone): detect sliced querysets #167 by @syedmustafan. This PR also unwraps a slice of a slice (qs[:50][:10]), as CodeRabbit suggested on fix(nplusone): detect sliced querysets #167, with a regression test that fails on the old code.select_related("product__category")— fix(nplusone): inherit outer eager loading in nested loops and suggest full relation paths #168 by @Nitjsefnie.skills/django-orm-lens1.2.0: Playbook D says the scan links inner loops to an outer prefetch from py-1.13.6, and keeps the manual checks for 1.13.5 and earlier.tests/test_mcp_server.pyimportsunittest.mockdirectly, closing the CodeQLpy/import-and-import-fromnote.cli/pyproject.toml,cli/server.json,smithery.yamland the pre-commitrev:in the READMEs.Test plan
cd cli && pytest -q— 1004 passed, 124 subtestspython -m mypy django_orm_lensandpython -m ruff check django_orm_lens tests— cleanselect_related("customer"), chain suggestsproduct__category, fully prefetched inner loop is no longer flagged.Closes nothing new: #145 and #146 are already closed by #167 and #168.
Summary by CodeRabbit