Repository navigation
Fix 'get_activities' crashing when 'limit' is passed - #365
Merged
Merged
Conversation
The 'activities' field is nested under 'project' in the GraphQl query so it must be looked up by 'project/activities' path. Lookup by 'activities' returned 'None' and raised AttributeError on 'set_limit'.
iLLiCiTiT
approved these changes
Oct 5, 2026
9 of 19 tasks
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.
Changelog Description
Fix
get_activitiesraisingAttributeError: 'NoneType' object has no attribute 'set_limit'whenever a non-zerolimitis passed.Additional info
activities_graphql_query()nests theactivitiesfield underproject, so its path isproject/activities.get_activitieslooked it up withget_field_by_path("activities"), which returnsNone, so the call crashed before any request was sent. The same pattern inget_eventsworks only becauseeventsis a top-level field. The bug is also present in released versions (seen in 1.2.9, 1.2.16, 1.2.22).With the correct path the limit bounds the result end to end for both orders: page size is
min(300, limit - fetched)(sent asfirstfor ascending,lastfor descending) and paging stops once the limit is reached.get_activity_by_iddoes not passlimitand was not affected. No otherget_field_by_pathcall in the repository uses a wrong nested path.Testing notes:
pytest tests/test_get_activities_limit.py- does not require a running AYON server.list(ayon_api.get_activities(project_name, limit=5))should return at most 5 activities instead of raising, and withorder=SortOrder.descendingthe 5 newest.