Update Dataset#
You can update a dataset if you need to change its details through the NeMo Entity Store microservice.
Prerequisites#
Before you can update a dataset, make sure that you have:
Obtained the base URL of your NeMo Entity Store Microservice.
Permissions to access the NeMo Entity Store microservice endpoint.
Obtained the
namespace
anddataset_name
of the dataset you want to update.
To Update a Dataset#
Choose one of the following options of updating a dataset.
Set up a NeMoMicroservices
client instance using the base URL of the NeMo Entity Store microservice and perform the task as follows.
from nemo_microservices import NeMoMicroservices
client = NeMoMicroservices(
base_url=os.environ["ENTITY_STORE_BASE_URL"]
)
response = client.datasets.update(
namespace="your-namespace", # Namespace that you create using NeMo Entity Store
dataset_name="your-dataset-name",
custom_fields={"size": "large", "focus": "active voice", "tone": "casual"},
)
print(response)
Make a PATCH request to the /v1/datasets/{namespace}/{dataset_name}
endpoint.
export ENTITY_STORE_BASE_URL=<URL for NeMo Entity Store>
export NAMESPACE="your-namespace" # Namespace that you create using NeMo Entity Store
export DATASET_NAME="your-dataset-name"
curl -X PATCH "${ENTITY_STORE_BASE_URL}/v1/datasets/${NAMESPACE}/${DATASET_NAME}" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"custom_fields": {
"size": "large",
"focus": "active voice",
"tone": "casual"
}' | jq
Example Response
{
"schema_version": "1.0",
"id": "dataset-EEeeZRcqNMTw1wFDtkVLn3",
"description": "your-dataset-description",
"type_prefix": null,
"namespace": "your-namespace",
"project": "string",
"created_at": "2025-02-14T21:13:21.306347",
"updated_at": "2025-02-14T21:13:21.306349",
"custom_fields": {
"size": "large",
"focus": "active voice",
"tone": "casual"
},
"ownership": {
"created_by": "user@domain.com",
"access_policies": {}
},
"name": "your-dataset-name",
"version_id": "main",
"version_tags": [],
"format": "json",
"files_url": "file://your-dataset-name.json/"
}