Can we write to a editable dataset using Python API

sagar_dubey
sagar_dubey Partner, Registered Posts: 17 Partner

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?

Answers

  • EliasH
    EliasH Dataiker, Registered Posts: 34 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)
Setup Info
    Tags
      Help me…