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 (<https://arize.com/docs/phoenix/sdk-api-reference/rest-api/datasets|API docs>, <https://arize-ai.github.io/phoenix/interfaces/_arizeai_phoenix-client.__generated___api_v1.paths.html#v1datasetsid|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 (<https://github.com/Arize-ai/phoenix/blob/main/packages/phoenix-client/docs/source/index.md|client docs>, <https://github.com/Arize-ai/phoenix/issues/9303|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 (<https://github.com/Arize-ai/phoenix/issues/9303|issue #9303>, <https://github.com/Arize-ai/phoenix/blob/main/.cursor/rules/client-migration.mdc|client migration guide>). Would you like more detail or code examples for these operations?
Sources:
- <https://arize.com/docs/phoenix/sdk-api-reference/rest-api/datasets|API docs>
- <https://arize-ai.github.io/phoenix/interfaces/_arizeai_phoenix-client.__generated___api_v1.paths.html#v1datasetsid|TypeScript API>
- <https://github.com/Arize-ai/phoenix/blob/main/packages/phoenix-client/docs/source/index.md|client docs>
- <https://github.com/Arize-ai/phoenix/issues/9303|issue discussion>
- <https://github.com/Arize-ai/phoenix/blob/main/.cursor/rules/client-migration.mdc|client migration guide>