Update a dataset item
dataset_items.update(strdataset_item_id, DatasetItemUpdateParams**kwargs) -> DatasetItem
PATCH/v5/dataset-items/{dataset_item_id}
Update the data payload and optional file associations of a dataset item.
The request replaces the item’s data in full and, if provided, its file associations; there is no partial-field merge. Data keys may not collide with reserved dataset- or evaluation-item field names, and any referenced files must exist and be a supported media format. Items that are archived or soft-deleted cannot be updated. The update is applied as a new dataset version rather than overwriting the previous record, so prior versions remain retrievable.
Update a dataset item
import os
from scale_gp_beta import SGPClient
client = SGPClient(
api_key=os.environ.get("SGP_API_KEY"), # This is the default and can be omitted
)
dataset_item = client.dataset_items.update(
dataset_item_id="dataset_item_id",
data={
"foo": "bar"
},
)
print(dataset_item.id){
"id": "id",
"content_hash": "content_hash",
"created_at": "2019-12-27T18:11:19.117Z",
"created_by": {
"id": "id",
"type": "user",
"object": "identity"
},
"data": {
"foo": "bar"
},
"updated_at": "2019-12-27T18:11:19.117Z",
"archived_at": "2019-12-27T18:11:19.117Z",
"dataset_id": "dataset_id",
"files": {
"foo": "string"
},
"object": "dataset.item"
}Returns Examples
{
"id": "id",
"content_hash": "content_hash",
"created_at": "2019-12-27T18:11:19.117Z",
"created_by": {
"id": "id",
"type": "user",
"object": "identity"
},
"data": {
"foo": "bar"
},
"updated_at": "2019-12-27T18:11:19.117Z",
"archived_at": "2019-12-27T18:11:19.117Z",
"dataset_id": "dataset_id",
"files": {
"foo": "string"
},
"object": "dataset.item"
}