Preserve 'linked' sideload data in PaginatedList (fixes #709) - #719
Open
dylangriffinshub wants to merge 1 commit into
Open
Preserve 'linked' sideload data in PaginatedList (fixes #709)#719dylangriffinshub wants to merge 1 commit into
dylangriffinshub wants to merge 1 commit into
Conversation
Compound-document Canvas responses (e.g. the grade change log) return a 'linked' section with sideloaded users/courses/assignments. PaginatedList discarded it when _root was set, so callers lost the data needed to resolve identifiers like sis_user_id without extra API calls. - Collect 'linked' from the original response before _root extraction - Merge sideloaded objects across all pages (dedup by id) - Expose via a read-only property - Add fixtures + tests for single-page and multi-page cases Fixes ucfopen#709
dylangriffinshub
requested review from
Thetwam,
bennettscience and
jonespm
as code owners
August 4, 2026 17:29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #709. Compound-document Canvas responses (e.g. the grade change log) return a
linkedsection with sideloadedusers/courses/assignments.PaginatedListdiscarded this data whenever_rootwas set, so callers lost the objects needed to resolve identifiers such assis_user_idwithout making extra API calls.Changes
linkedsection from the original response before any_rootextraction.id.linkedproperty onPaginatedList.Example
```python
events = course.get_grade_change_events()
for event in events:
...
sideloaded users/courses/assignments are now available:
events.linked["users"] # -> [{"id": "U1", "name": "Alice"}, ...]
events.linked["courses"] # -> [{"id": "C1", "name": "Math"}]
```
Backward compatible: responses without a
linkedsection return an empty dict. All existingtest_paginated_list/test_grade_change_logtests still pass, plus 2 new tests.Closes #709