There seems to be a limited number of methods on the client.datasets object. In particular, how do I delete a dataset, or update it with a new version? Currently it seems I am forced to delete it from the UI?
You can delete a dataset programmatically using the Python client or REST API; the client.datasets object supports deletion via the delete method, which calls the /v1/datasets/{id} endpoint (API docs, TypeScript API). For updating a dataset with new examples, use add_examples_to_dataset, which appends data and creates a new version鈥攈owever, you cannot overwrite or replace the entire dataset in place; full upsert or replacement is not currently supported (client docs, issue discussion).If you need to update the dataset content entirely, the current workaround is to delete the dataset and recreate it, or use versioning by appending new examples. Direct in-place editing or overwriting of all examples is not available via the SDK or API as of now (issue #9303, client migration guide). Would you like more detail or code examples for these operations?Sources:
- API docs
- TypeScript API
- client docs
- issue discussion
- client migration guide
馃挕聽Hint: Mention RunLLM in the thread for followups.
Hi Rasmus B. - the bot is correct here. This is the more exhaustive list of what you can do with datasets using the REST API (including delete). https://arize.com/docs/phoenix/sdk-api-reference/rest-api/api-reference/datasets
When you add examples to the data (update) it will be versioned
thanks 馃敀[private user] feel like I searched the python API and did not see the delete method, will check again. Otherwise I will try REST. Is there a shortcut for sending REST calls through the client with the correct headers etc?
The Python client does not expose a direct delete method on client.datasets in all versions, but you can use the underlying HTTP session of the client to send REST calls with the correct headers and authentication automatically handled (client docs). For example, you can use client._client.delete("/v1/datasets/{id}") to send a DELETE request with proper headers.Would you like a code example for this approach?Sources:
- client docs
馃挕聽Hint: Mention RunLLM in the thread for followups.
