Create and populate Editable Datasource with API

benmoss
benmoss Partner, Dataiku DSS Core Designer, Dataiku DSS Adv Designer, Registered Posts: 10 Partner

Hi!

I'm looking at the different API end-points in regards to creating datasources.

Specifically in this case I am looking for a method of initially creating an editable datasource and then populating that editable datasource with data.

The first part seems possible but I can't see any documentation to say that the 2nd part is also. Has anyone tried to do anything similar?

Simple table to load as an example.

PersonAge
Ben31
Charlotte28

Ben

Tagged:

Answers

  • Emma
    Emma Dataiker, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 52 Dataiker
    edited July 17

    Hey @benmoss
    ,

    Great questions. Editable Datasets are really meant to be modified through the UI.

    However, if you have need to use them then a workaround was detailed in this Community post: https://community.dataiku.com/t5/Using-Dataiku/Can-we-write-to-a-editable-dataset-using-Python-API/m-p/16760

    If your use case can be served without having an Editable Dataset (you are hoping to create and then populate a dataset entirely programmatically) you can do so with the generic Dataiku Dataset API:

    # Get the Dataiku client 
    client = dataiku.api_client()
    project = client.get_project("ProjectKey")
    
    # Create the Dataset
    builder = project.new_managed_dataset("mydatasetname")
    builder.with_store_into("TargetLocation")
    dataset = builder.create()
    
    # Now modify the Dataset in some way
    mydatasetname = ... 

    Hope that helps,

    Emma

Setup Info
    Tags
      Help me…