Skip to content

feat: Deepen all SDK clients — typed Pydantic returns, mutable default fixes, 249 tests#3

Merged
ssbean merged 6 commits intomasterfrom
feat/deepen-datasets-client
Mar 3, 2026
Merged

feat: Deepen all SDK clients — typed Pydantic returns, mutable default fixes, 249 tests#3
ssbean merged 6 commits intomasterfrom
feat/deepen-datasets-client

Conversation

@ssbean
Copy link

@ssbean ssbean commented Mar 3, 2026

Summary

Systematic deepening of every API client in the SDK:

  • All 22 client pairs (sync + async) now return typed Pydantic models instead of raw dict/list
  • All mutable defaults eliminated — every = [] and = {} replaced with Field(default_factory=...)
  • New S3Export model created for s3_export client pair
  • 10+ new DataSet endpoints — sharing, tags, partitions, upload sessions, properties
  • New Stream endpointssearch(), get_execution()
  • 249 tests covering sync (MagicMock transport) + async (respx) for every client
  • Lint clean via ruff

Clients deepened

Client New Tests Notes
datasets 30 sync + 19 async 10 new endpoints added
streams 12 sync + 9 async search(), get_execution() added
groups 8 sync
users 6 sync
pages 9 sync
roles 6 sync + 6 async
accounts 7 sync + 4 async
alerts 5 sync + 5 async
cards 5 sync + 5 async
activity_log 2 sync + 1 async
connectors 1 sync + 1 async
dataflows 4 sync + 4 async
embed 2 sync + 2 async
files 3 sync + 2 async
projects 10 sync + 5 async
s3_export 2 sync + 2 async New S3Export model
workflows 5 sync + 4 async

Testing

249 passed in 0.90s
All ruff checks passed!

🤖 Generated with Claude Code

ssbean and others added 6 commits March 3, 2026 22:30
Migrate DataSetClient and AsyncDataSetClient from returning raw dicts
to returning typed Pydantic models (DataSet, QueryResult, Policy,
DataSetPermission, DataVersion, Schema, Index, Partition).

Add new endpoints:
- set_tags: tag management via Product API
- share / revoke_access: granular permission sharing
- list_partitions / delete_partition: partition management
- create_upload_session / upload_part / commit_upload: multi-part uploads
- set_properties: dataset property updates
- data_import_from_file / data_export_to_file: file-based I/O (async)

Fix mutable default fields in models (list/dict → Field(default_factory=...)).
Add UploadSession and SharePermission models.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Migrate StreamClient and AsyncStreamClient to return typed models
(Stream, StreamExecution). Add search() and get_execution() endpoints.
Add sync and async test suites (21 tests).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Migrate GroupClient, UserClient, PageClient (sync + async) from raw
dicts to typed Pydantic models (Group, User, Page, PageCollection).
Fix mutable default fields in Page model. Add test suites for all
three clients (23 new tests).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Migrate all four clients (sync + async) to return typed Pydantic models
instead of raw dicts. Fix mutable default fields across all model files.
Add comprehensive sync and async test suites (43 new tests).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Migrate activity_log, connectors, dataflows, embed, files, projects,
s3_export, and workflows clients (sync + async) to return typed Pydantic
models. Fix mutable defaults in embed, files, projects, and workflows
model files. Create S3Export model. Add 50 new tests across all clients.

249 tests pass, lint clean.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…h models

Replace remaining = [] and = {} defaults with Field(default_factory=...)
in ai.py (9 fields) and search.py (5 fields). Zero mutable defaults now
remain across all model files in the SDK.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ssbean ssbean force-pushed the feat/deepen-datasets-client branch from 60ee6c9 to ad0fe05 Compare March 3, 2026 22:30
@ssbean ssbean merged commit 1634cff into master Mar 3, 2026
1 of 6 checks passed
@ssbean ssbean deleted the feat/deepen-datasets-client branch March 3, 2026 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant