Add job_ids filter param to GET /api/assets#13848
Closed
mattmillerai wants to merge 5 commits into
Closed
Conversation
- Remove [cloud-only] marker from job_ids param in openapi.yaml - Add job_ids field to ListAssetsQuery schema with CSV/list parsing - Pass job_ids through route -> service -> query layer - Filter AssetReference by job_id IN (...) on both data and count queries Co-authored-by: Matt Miller <MillerMedia@users.noreply.github.com>
Tests cover: - Single job_id filter - Multiple job_ids filter (IN clause) - Empty job_ids returns all results - Non-matching job_ids returns empty - job_ids combined with tag filters Co-authored-by: Matt Miller <MillerMedia@users.noreply.github.com>
- Validate each token is a valid UUID (normalizes case); invalid input returns 422 - Raise on non-string list items instead of silently dropping - Raise on unexpected input types instead of forwarding raw value - Deduplicate tokens to avoid redundant IN clause bind params - Cap list at max_length=100 to prevent oversized IN clauses
mattmillerai
added a commit
that referenced
this pull request
May 20, 2026
Aligns with the parallel hardening from draft PR #13848 (now closed as a duplicate). The validator now: - Raises ValueError on non-string list items (was: silently dropped). - Raises ValueError on non-string / non-list top-level values like dict or int (was: silently passed through to Pydantic's downstream coercion). Adds tests-unit/assets_test/queries/test_list_assets_query.py covering the validator end-to-end: CSV canonicalization, dedup order, default empty, invalid UUID, non-string list item, non-string non-list value, and the max_length=500 boundary.
Contributor
Author
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
Adds
job_idsfilter support toGET /api/assetson the Python local server, matching the existing behavior in the Go cloud ingest service. This enables frontend consumers to drill down into assets associated with specific jobs.Changes
openapi.yaml[cloud-only]marker andx-runtime: [cloud]from thejob_idsparameter, making it available on the local server.app/assets/api/schemas_in.pyjob_ids: list[str]field toListAssetsQuerywith a_split_csv_job_idsvalidator that accepts both comma-separated strings and repeated query params (matching theinclude_tags/exclude_tagspattern).app/assets/api/routes.pyq.job_idsthrough from the route handler tolist_assets_page.app/assets/services/asset_management.pyjob_idsparameter tolist_assets_pageand forwards it tolist_references_page.app/assets/database/queries/asset_reference.pyjob_idsparameter tolist_references_page.WHERE asset_references.job_id IN (...)filter on both the data query and the count query whenjob_idsis non-empty.tests-unit/assets_test/queries/test_asset_info.py