feat(llm-obs): add dataset batch-update, clone, restore subcommands#540
Merged
platinummonkey merged 3 commits intoMay 30, 2026
Merged
Conversation
Wrap three new SDK endpoints introduced in datadog-api-client-rust PR #1655 (available at rev d4954b11 picked up by chore/upgrade-dd-sdk-to-master): - `pup llm-obs datasets batch-update` — batch insert/update/delete records via LLMObsDatasetBatchUpdateRequest / batch_update_llm_obs_dataset - `pup llm-obs datasets clone` — clone a dataset into a new dataset via LLMObsDatasetCloneRequest / clone_llm_obs_dataset - `pup llm-obs datasets restore` — restore a dataset to a previous version via LLMObsDatasetRestoreVersionRequest / restore_llm_obs_dataset_version Changes: - src/commands/llm_obs.rs: add datasets_batch_update, datasets_clone, datasets_restore functions; add 6 tests (happy-path + error for each) - src/main.rs: add BatchUpdate/Clone/Restore variants to LlmObsDatasetsActions and dispatch arms - src/client.rs: add 3 new unstable op IDs; update count assertion 162 → 165 - docs/COMMANDS.md: update llm-obs datasets command listing Co-Authored-By: Claude <noreply@anthropic.com> https://claude.ai/code/session_01MaHfvEkY66q99gwcPZi4Xc
This comment has been minimized.
This comment has been minimized.
restore_llm_obs_dataset_version returns no body; binding its unit result tripped clippy::let_unit_value (-D warnings) and broke the Check/Test and Windows cross-compile jobs. Follow the delete pattern: call, then print a confirmation. Co-Authored-By: Claude <noreply@anthropic.com>
The batch-update/clone/restore tests built request JSON with stale field names (type "dataset_*", missing required id, wrong attribute keys), so util::read_json_file failed before the API call and the happy-path asserts panicked. Align bodies with the real SDK models: - data.id required; data.type is "datasets" - batch-update attrs use insert_records/delete_records - restore attr is dataset_version (not version) - batch-update response data is an array (LLMObsDatasetRecordsMutationResponse) Co-Authored-By: Claude <noreply@anthropic.com>
3797c1d
into
chore/upgrade-dd-sdk-to-master
6 checks passed
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 three new
pup llm-obs datasetssubcommands that wrap the new SDK endpoints from datadog-api-client-rust PR #1655, available in the SDK rev picked up by the base branch (chore/upgrade-dd-sdk-to-master).Changes
src/commands/llm_obs.rs— adddatasets_batch_update,datasets_clone,datasets_restorefunctions following the exact pattern of existing dataset commands; 6 new tests (happy-path + error for each command)src/main.rs— addBatchUpdate,Clone,Restorevariants toLlmObsDatasetsActionsenum with--project-id,--dataset-id,--fileargs; add dispatch armssrc/client.rs— addv2.batch_update_llm_obs_dataset,v2.clone_llm_obs_dataset,v2.restore_llm_obs_dataset_versiontoUNSTABLE_OPS; update count assertion 162 → 165docs/COMMANDS.md— update llm-obs datasets listing to include the three new subcommandsNew commands
Testing
mock_anyfor SDK-routed calls, status-specific mocks for error pathslock_env+cleanup_envfor safe env-var isolationNotes
This PR is stacked on
chore/upgrade-dd-sdk-to-master(PR #539) which bumps the SDK rev tod4954b11. CI will need that base branch merged (or the SDK fetched) for compilation to succeed.🤖 Generated with Claude Code
https://claude.ai/code/session_01MaHfvEkY66q99gwcPZi4Xc
Generated by Claude Code