feat(api): generate and migrate Dataset REST resources - #703
Open
Abhijeet Prasad (AbhiPrasad) wants to merge 1 commit into
Open
feat(api): generate and migrate Dataset REST resources#703Abhijeet Prasad (AbhiPrasad) wants to merge 1 commit into
Abhijeet Prasad (AbhiPrasad) wants to merge 1 commit into
Conversation
Abhijeet Prasad (AbhiPrasad)
requested review from
Luca Forstner (lforst) and
Andrew Kent (realark)
August 18, 2026 17:57
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c131e9bc45
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
Abhijeet Prasad (AbhiPrasad)
force-pushed
the
abhi-openapi-datasets
branch
from
August 18, 2026 19:05
c131e9b to
6b2430c
Compare
Implements the Dataset slice of #683 by publishing all operations tagged Datasets and moving eligible high-level SDK workflows onto the public REST resources. Shared generated models are repartitioned across Projects, Experiments, and Datasets as their reachable schema graph expands. ### Migration flow ```text Before init_dataset() -----> APP /api/dataset/register Dataset.fetch() ----> API /btql Dataset.summarize() -> API /dataset-summary After +--> POST /v1/project --------+ init_dataset() -------| +--> POST /v1/dataset +--> GET /v1/project/{id} -----+ Dataset.fetch() ------> POST /v1/dataset/{id}/fetch --> backend BTQL Dataset.summarize() --> GET /v1/dataset/{id}/summarize ``` | SDK workflow | Previous wire call | Public REST call | | --- | --- | --- | | Resolve/create project | Combined dataset registration | `POST /v1/project` or `GET /v1/project/{id}` | | Resolve/create dataset | `POST /api/dataset/register` | `POST /v1/dataset` | | Fetch ordinary records | `POST /btql` | `POST /v1/dataset/{id}/fetch` | | Fetch filtered records | `POST /btql` | Unchanged for `_internal_btql` | | Summarize | `GET /dataset-summary` | `GET /v1/dataset/{id}/summarize` | | Devserver ID lookup | Raw `GET /v1/dataset/{id}` | Generated `GET /v1/dataset/{id}` | | Insert/update/delete rows | Batched `/logs3` ingestion | Unchanged | | Resolve environments | `GET /environment-object/...` | Unchanged | | Behavior | Result | | --- | --- | | Dataset name omitted | Send `logs`, matching the legacy registration UDF default | | Existing project or dataset | Public POST operations preserve get-or-create behavior | | Registration atomicity | Project and dataset creation are now two requests, matching `bt` | | Ordinary fetch semantics | REST builds the same dataset BTQL query with cursor, limit, and version | | Custom BTQL semantics | Continue through BTQL for filters, sampling, and total limits | | Legacy output conversion | Continue converting `expected` to `output` after REST fetches | | Summary links | Continue using the SDK-configured `BRAINTRUST_APP_PUBLIC_URL` | | Event wire keys | Preserve `_is_merge`, `_object_delete`, and other leading-underscore keys exactly | | Retry behavior | Fetch is a safe read; project and dataset creation are idempotent writes | The generated Dataset service includes create/list/get/patch/delete, insert, GET and POST fetch, feedback, and summarize. Public request and response types are exported from `braintrust.api.types`. Real-backend VCR coverage exercises the complete generated surface, including merge paths, array deletion, and row deletion, plus a high-level unnamed `logs` dataset flow with cleanup. Unit coverage preserves pagination, pinned versions, BTQL routing, devserver lookup, lazy imports, and package/type exports. Verification includes `test_core`, `test_types`, Pylint, pre-commit, and API codegen drift checks.
Abhijeet Prasad (AbhiPrasad)
force-pushed
the
abhi-openapi-datasets
branch
from
August 18, 2026 19:18
6b2430c to
90a8cc6
Compare
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.
AI Summary
Implements the Dataset slice of #683 by publishing all operations tagged Datasets and moving eligible high-level SDK workflows onto the public REST resources. Shared generated models are repartitioned across Projects, Experiments, and Datasets as their reachable schema graph expands.
Migration flow
POST /v1/projectorGET /v1/project/{id}POST /api/dataset/registerPOST /v1/datasetPOST /btqlPOST /v1/dataset/{id}/fetchPOST /btql_internal_btqlGET /dataset-summaryGET /v1/dataset/{id}/summarizeGET /v1/dataset/{id}GET /v1/dataset/{id}/logs3ingestionGET /environment-object/...logs, matching the legacy registration UDF defaultbtexpectedtooutputafter REST fetches