cancel
Showing results for 
Search instead for 
Did you mean: 

AI Catalog dataset naming via Python API

ZA
Blue LED

AI Catalog dataset naming via Python API

Is it possible to rename an AI Catalog dataset using the python API? The function automatically names the dataset 'data.csv' when uploading and seems to provide no arguments to name or rename. I'm feeding a pandas dataframe to dr.Dataset.create_from_in_memory_data.
Labels (1)
0 Kudos
4 Replies

Thanks Vitalii! That works perfectly.

0 Kudos
ZA
Blue LED

Stepping outside the Python client package seems worth while. I'll use the 'requests' package to pull more API functionality.

requests.patch('%s/datasets/%s/'%(endpoint, datasetID),\
    headers={'Authorization''token %s'%os.environ['DATAROBOT_API_TOKEN']},\
         files={'name': (None,'New Data Name')})

 

Vitalii.Peretiatko
Data Scientist
Data Scientist

Hi ZA,

 

Welcome to DataRobot Community!

 

Yes, it's possible to modify dataset name via Python API. Here's how:

dataset = dr.Dataset.get('your_dataset_id')
dataset.modify(name='A Better Name')

 

You can find other useful examples of our python client in the docs, e.g. python public api client 

 

Best regards,

Vitalii

ZA
Blue LED

I'm able to update it using PATCH /api/v2/datasets/(datasetId)/; but it's not native to the python API package.

0 Kudos