Announcing the winners & finalists of the Dataiku Frontrunner Awards 2021! Read their inspiring stories

Can we write to a editable dataset using Python API

sagar_dubey
Level 1
Level 1
Can we write to a editable dataset using Python API

Hi,

I have created a editable dataset and using a python script I am trying to update some of the records in that dataset but getting the following error - 

TransactionContextError: java.lang.RuntimeException: The transaction associated to the current thread is read-only

Is it possible to write to a editable dataset like regular dataset ? If not, is there any way we can achieve this?

0 Kudos
1 Reply
EliasH
Dataiker
Dataiker

Hi @sagar_dubey 

Editable datasets are different from other datasets. In the standard way they can be modified only from the UI, hence the error you get when trying to modify it programmatically from the API.

A possible solution for you could be to write to managed dataset (not editable one) and then use a "push to editable" recipe that will copy this dataset into an editable dataset.

If you want this to be programmatic I recommend:
- create a managed dataset with the data you want to write
- trigger the recipe that will "sync" the managed dataset to the editable dataset
- check the difference between the data you want to write and the data in the editable dataset (that another user can potentially modify via the UI)
A banner prompting to get Dataiku DSS