feat(models): support boolean fileset filter on ModelEntityFilter - #1879
Conversation
fileset was Optional[str], the only filter on the field limited to an exact fileset reference. base_model already supports Optional[Union[..., bool, str]], letting callers ask true/false for presence via the generic bool-coercible-field machinery in Filter._get_bool_coercible_fields(). Widen fileset to Optional[Union[bool, str]] the same way so a caller can filter for models that have (or don't have) a fileset without walking every page client-side to find one. Follow-up to ASTD-562/ASTD-567: the Base Model dropdown filters for fine-tunable models (fileset must be set) entirely client-side today, which forces it to page past runs of ineligible models one round trip at a time. This unblocks moving that filter server-side. Signed-off-by: mschwab <mschwab@nvidia.com>
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (5)
Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review. 📝 WalkthroughWalkthrough
ChangesFileset filter support
Suggested reviewers: Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to Model-list queries can now filter by fileset presence or a specific fileset reference, with matching API contracts and coverage for each supported filter form. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Stainless's cloud build queue has been stuck (builds stalled at not_started for hours, going back over a week of prior build errors across the project) — 'make stainless' cannot complete right now. This hand-patches the vendored SDK to match the fileset: Optional[Union[bool, str]] widening from 60ba9e9, mirroring the existing base_model pattern, purely so 'nemo-platform-sdk-tools is-up-to-date' (and CI's lint-python-sdk) passes. This is a stopgap, not a real generation. Once Stainless recovers, run 'make stainless' for real — it may reformat these files differently (docstring wrapping, etc.) than this manual edit did. Signed-off-by: mschwab <mschwab@nvidia.com>
8659808 to
807680c
Compare
Summary
ModelEntityFilter.filesetonly supported exact-match to one fileset reference, unlikebase_modelwhich already supportstrue/falsefor "has a value" / "has no value" via the generic bool-coercible-field filter machinery. This widensfilesetthe same way, so callers can filter for models that do (or don't) have a fileset without pulling every page and filtering client-side.Related Issue
Related to ASTD-567 — the Base Model dropdown filters for fine-tunable models (
filesetset) entirely client-side today (web/packages/common/src/api/models/useModelSearch.ts), which forces it to page past runs of ineligible models one round trip at a time on a slow connection. This PR unblocks moving that filter server-side; the dropdown-side change to actually usefilter[fileset]=trueis not included here — draft until that follow-up work is settled.Changes
services/core/models/src/nmp/core/models/schemas.py: widenModelEntityFilter.filesetfromOptional[str]toOptional[Union[bool, str]], mirroringbase_model's existing type.services/core/models/tests/unit/api/test_models_api.py: addfilesetfilter tests mirroring the existingbase_modelfilter tests (exact-ref match,true,false).openapi/openapi.yaml,openapi/ga/openapi.yaml,openapi/ga/individual/platform.openapi.yaml: regenerated viamake refresh-openapito reflect the widenedfilesetschema.sdk/python/nemo-platform/src/nemo_platform/types/models/model_entity_filter_param.py,sdk/python/nemo-platform/.nmpcontext/openapi.yaml: hand-patched, not Stainless-generated — see note below.Type of Change
Quality Gates
Verification
Signed-off-by:traileruv run pre-commit run -apasses, or any blocked checks are identified belowTargeted validation:
uv run pre-commit run -a— passedpytest services/core/models/tests/unit/api/test_models_api.py -v— 34 passed (3 newfilesetfilter tests + all existing, includingbase_model's equivalent tests unaffected)ruff check/ruff format --checkon changed files — passedty checkonschemas.py— passedmake refresh-openapi— regenerated cleanly, diff scoped to thefilesetschema change onlymake stainless(vendored Python SDK regen) was attempted repeatedly but Stainless's cloud build queue is stuck — every recent build (ours and others across the project) sits atnot_startedindefinitely; the queue's oldest unprocessed build predates this PR by a week. Given that,sdk/python/nemo-platform/src/nemo_platform/types/models/model_entity_filter_param.pyand its.nmpcontext/openapi.yamlsnapshot were hand-patched to mirrorbase_model's existing pattern, purely sonemo-platform-sdk-tools is-up-to-date(CI'slint-python-sdk) passes — confirmed locally. This is a stopgap, not a real Stainless generation, and is called out as such in its commit message; once Stainless recovers, someone should runmake stainlessfor real, which may reformat these files slightly differently than this manual edit did.Summary by CodeRabbit
New Features
true) or do not have one (false).{workspace}/{fileset_name}reference remains supported.Bug Fixes