Skip to content

with_solr_cache: honour offset when slicing cached full results (fixe…#71

Merged
Robbie1977 merged 1 commit into
mainfrom
development
Jul 12, 2026
Merged

with_solr_cache: honour offset when slicing cached full results (fixe…#71
Robbie1977 merged 1 commit into
mainfrom
development

Conversation

@Robbie1977

Copy link
Copy Markdown
Contributor

…s owlery-family paging)

Paged owlery-family queries (NeuronsPartHere, PartsOf, SubclassesOf, neurons_synaptic/pre/post, etc.) served every page by slicing the cached full result with [:limit], ignoring offset, so page 2+ returned the same rows as page 1. The client's duplicate-first-row guard then halted the stream at ">10000", leaving big generic terms (e.g. nervous system: 18262 neurons / 20870 parts) looking unpopulated.

Two fixes in the @with_solr_cache wrapper:

  • Force offset=0 on every limit=-1 (full) kwargs copy so the cached full set is always complete, regardless of which page first triggered the compute.
  • Slice returns with [offset:offset+limit] (and DataFrame .iloc[...]) instead of [:limit]/.head(limit), preserving the true total count.

AllAlignedImages is unaffected (it pages via its own id-index, not this slice path). The term_info preview slice is unchanged (offset not applicable).

…s owlery-family paging)

Paged owlery-family queries (NeuronsPartHere, PartsOf, SubclassesOf, neurons_synaptic/pre/post, etc.) served every page by slicing the cached full result with [:limit], ignoring offset, so page 2+ returned the same rows as page 1. The client's duplicate-first-row guard then halted the stream at ">10000", leaving big generic terms (e.g. nervous system: 18262 neurons / 20870 parts) looking unpopulated.

Two fixes in the @with_solr_cache wrapper:
- Force offset=0 on every limit=-1 (full) kwargs copy so the cached full set is always complete, regardless of which page first triggered the compute.
- Slice returns with [offset:offset+limit] (and DataFrame .iloc[...]) instead of [:limit]/.head(limit), preserving the true total count.

AllAlignedImages is unaffected (it pages via its own id-index, not this slice path). The term_info preview slice is unchanged (offset not applicable).
@Robbie1977 Robbie1977 merged commit f12c412 into main Jul 12, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant