feat: training set SDK support (DE-8692) - #480
Draft
luke-e-schaefer wants to merge 3 commits into
Draft
Conversation
…collections (DE-8692) Add a TrainingSet resource mirroring Benchmark: a mutable, versioned, model-scoped collection of dataset_item ids spanning one or more datasets. - nucleus/training_set.py: TrainingSet dataclass (from_json, refresh, update, delete, items, add_items, remove_items, new_version, family) with lineage fields (parent_training_set_id, version_major/minor/label). - NucleusClient methods: create_training_set (model-scoped, unified source signature incl. training_set_ids), get/list/update/delete, add/remove/list items, create_training_set_version, list_training_set_family, repin, and get_model_training_set. - Model.create_training_set, Model.training_set, Model.repin_training_set. - TrainingSetItemsPage DTO; new *_KEY constants (TRAINING_SET_ID(S)_KEY, PARENT_TRAINING_SET_ID_KEY); reuse existing item/slice/dataset/version keys. - Exports, version bump 0.21.2 -> 0.21.3, CHANGELOG entry. - tests/test_training_sets.py: 28 fully-mocked tests (no live API). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…nload_items) (DE-8692) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Training Set SDK support (DE-8692)
Adds SDK support for training sets — a mutable, versioned, model-scoped collection of
dataset_itemids spanning one or more source datasets. Structurally a clone of the existingBenchmarkresource, minus the freeze/finalize (training sets stay mutable).Ticket: DE-8692
What's added
nucleus/training_set.py—TrainingSetdataclass mirroringBenchmark:from_json,refresh,update,delete,items,add_items,remove_items,new_version,family, lineage fields.NucleusClientmethods:create_training_set,get_training_set,list_training_sets,get_model_training_set,repin_training_set,update/delete_training_set,list/add/remove_training_set_items,create_training_set_version,list_training_set_family.Modelentry points:Model.create_training_set(...),Model.training_set,Model.repin_training_set(...).item_ids,items=[{dataset_id, reference_id}],slice_id(s),dataset_id(s), andtraining_set_ids(merge other training sets), plus versioning kwargs (parent_training_set_id,bump_type,removed_item_ids). Async job polled to completion, then re-fetch.TrainingSetItemsPageDTO;__all__exports;pyproject.tomlpatch bump (0.21.2 → 0.21.3) + CHANGELOG entry.Tests
tests/test_training_sets.py— 28 fully-mocked tests (no live API), modeled ontest_benchmarks.py. Covers create from each source type, add/remove items, item pagination,new_version, and repin.pytest tests/test_training_sets.py→ 28 passed; benchmark suite still 31 passed.🤖 Generated with Claude Code