Skip to content

Entity lists: Support advanced filters in get_entity_lists - #385

Merged
iLLiCiTiT merged 2 commits into
developfrom
enhancement/entity-lists-label-filter
Nov 18, 2026
Merged

iLLiCiTiT merged 2 commits into
developfrom
enhancement/entity-lists-label-filter

Conversation

@BigRoy

@BigRoy BigRoy commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Changelog Description

Add a filters argument (advanced QueryFilter) to get_entity_lists, so entity lists can be filtered on the server, e.g. by label.

Additional info

Finding a few lists by label meant fetching every list in the project and filtering on the client, 300 lists per GraphQL page. On projects with thousands of lists that takes many sequential requests, and the number of requests grows as more lists are created.

  • New keyword argument: get_entity_lists(project_name, *, list_ids=None, active=None, filters=None, fields=None).
  • filters is passed to the filter argument of project.entityLists, the same way get_folders, get_tasks and get_versions handle it. The server whitelists label, owner, entity_type, entity_list_type, created_at, updated_at, count, active, created_by and updated_by.
  • Requires AYON server 1.8.3+ when filters is used.
  • Lookup by label (labels are unique per project and indexed):
    filters = {"conditions": [{"key": "label", "operator": "in", "value": labels}]}
    ayon_api.get_entity_lists(project_name, filters=filters)

Expected to ship in ayon-python-api 1.2.29.

Testing notes:

  1. Offline: pytest tests/test_entity_lists_filters.py checks that filters is sent to the server and that nothing is sent without it.
  2. Live server: pytest tests/test_review_tasks_lists_api.py -k entity_lists_filters covers exact match on label, case sensitivity, quotes, %/_ characters and unknown labels.
  3. Manual check on a local server (1.17.5) with 950 lists: looking up 2 labels took 4 GraphQL requests without a filter and 1 request with filters=.

Filter entity lists by exact label on server using 'filter' argument
of 'entityLists' (AYON server 1.8.3+), with client side fallback for
older servers. Empty 'labels' or 'list_ids' iterables return nothing.
Comment thread ayon_api/_api_helpers/lists.py Resolved
Pass advanced filters through to the 'filter' argument of
'entityLists', like other entity getters do, instead of a dedicated
'labels' argument. Callers can filter by any whitelisted column and
the client side fallback for servers older than 1.8.3 is not needed.
@BigRoy BigRoy changed the title Entity lists: Filter by labels in get_entity_lists Entity lists: Support advanced filters in get_entity_lists Nov 18, 2026
@BigRoy
BigRoy marked this pull request as ready for review November 18, 2026 12:57
@iLLiCiTiT
iLLiCiTiT merged commit 28a763d into develop Nov 18, 2026
3 checks passed
@iLLiCiTiT
iLLiCiTiT deleted the enhancement/entity-lists-label-filter branch November 18, 2026 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants