cancel
Showing results for 
Search instead for 
Did you mean: 

AI Catalog dataset naming via Python API

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
2 Solutions

Accepted Solutions

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

View solution in original post

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')})

 

View solution in original post

4 Replies

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

0 Kudos

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

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')})

 

Thanks Vitalii! That works perfectly.

0 Kudos