phoenix
phoenix copied to clipboard
fix(splits): Make split assignment idempotent
[!NOTE] Replaces add/remove split mutations with a single idempotent set-example-splits operation and updates the UI to use it with improved menu behavior.
- GraphQL API:
- Remove
addDatasetExamplesToDatasetSplitsandremoveDatasetExamplesFromDatasetSplitsinputs/mutations/payloads.- Add
setDatasetExampleSplitswithSetDatasetExampleSplitsInputandSetDatasetExampleSplitsMutationPayloadreturning a singleexample.- Backend (
src/phoenix/server/api/mutations/dataset_split_mutations.py):
- Implement
set_dataset_example_splitsto atomically set splits for anexample(validates IDs, deletes missing, inserts new; usesjoinedloadandtuple_).- Remove legacy add/remove example-split mutations and related types.
- Frontend (
app/src/pages/examples/ExamplesSplitMenu.tsx):
- Switch to
ExamplesSplitMenuSetDatasetExampleSplitsMutationand update apply logic to send fullsplitIdsperexampleId.- Change apply menu to single-select with manual open-state control to keep menu open on actions; add
onActionhandler and checkbox state sync.- Remove generated file for old remove mutation; add/update generated file for new set mutation.
Written by Cursor Bugbot for commit 18bb22d2901a75950eebc305c6a108b2d9f6ebea. This will update automatically on new commits. Configure here.