feat: add SetsClient for persistent saved sets - #17
Merged
Conversation
Adds a SetsClient mirroring the other resource clients, exposing the /sets CRUD API plus a save_set() convenience for the common "save these rows as a named set" flow: - get_sets / get_set / create_set / update_set / delete_set / save_set - project_id falls back to DATAMAKER_PROJECT_ID (convenient in sandbox envs) - wired into routes/__init__.py and main.py (delegating methods + .sets property) - TestSetsClient unit tests + a Set Management section in llms.txt Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
RatulMaharaj
approved these changes
Jun 24, 2026
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 a
SetsClientto the Python SDK so users (and DataMaker sandbox scripts) can manage sets — persistent, named snapshots of generated/fetched rows (e.g. a pinned regression dataset or a shared fixture). This is the SDK half of the new Sets feature in the main DataMaker app; the/setsCRUD API it talks to already exists server-side.What's included
routes/sets.py→SetsClientwith the full CRUD surface:get_sets(project_id=None)— list (scoped by project; falls back toDATAMAKER_PROJECT_ID)get_set(set_id)— fetch one, including its fulldatapayloadcreate_set(name, data=None, description=None, row_count=None, project_id=None)update_set(set_id, ...)— sends only provided fieldsdelete_set(set_id)save_set(name, data, description=None, project_id=None)— convenience for the common "save these rows as a named set" flow, pulling project context fromDATAMAKER_PROJECT_IDwhen omittedroutes/__init__.pyandmain.py(delegating methods on the top-levelDataMakerclient + a.setsproperty for direct access), mirroring the existing resource clients.TestSetsClientunit tests covering list (scoped/unscoped), get, create (full/minimal/env-fallback/validation), update, delete, andsave_set.llms.txt.Usage
Testing
Full unit suite green locally — 62 passed, 24 skipped (integration tests skip without a live API key).
ruff formatclean on the new/changed files.🤖 Generated with Claude Code