How to clear metrics for a dataset from Python

JIshikawa
Level 3
How to clear metrics for a dataset from Python

Hi,

I know there is an option for this in the UI but I need to clear all metrics for datasets programmatically. The reason is that in my current set up, metrics are being computed every time a dataset has been rebuild.

So with every new build, the metrics of each run are getting stored but I am only interested in the latest version.

 

I have tried the following but the metrics were not cleared.

import dataiku
import json

client=dataiku.api_client()
project = client.get_default_project() 
dataset=project.get_dataset("test_dataset")

# clear metrics
dataset.get_settings().get_raw()["metrics"] = []

Operating system used: Mac

 

0 Kudos
1 Reply
JIshikawa
Level 3
Author

It seems a found a workaround by changing the settings from Metrics history" to "Metrics last values"

 

dss.png

0 Kudos