Saving a datframe as a csv into a managed folder from python endpoint

ssuhas76
ssuhas76 Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Registered Posts: 31

Hello,

I am trying to export a dataframe as a csv file into a managed folder from the endpoint python function.

How can this be done?

Tagged:

Answers

  • Turribeach
    Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,090 Neuron

    What exactgly do you mean by endpoint python function? Please explain your requirement properly. And API endpoint function is supposed to respond to API calls via REST. Why would you want to return data via a managed folder? It makes no sense.

  • ssuhas76
    ssuhas76 Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Registered Posts: 31

    I should have framed my question in a better way. We are receving some data in JSON which we convert into a dataframe. This dataframe is supposed to be stored as a csv file in a managed folder. How can i accomlish this?

  • Turribeach
    Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,090 Neuron

    This is still not clear to me. How are you receiving this data? Is it using an Dataiku API endpoint function running in the API node? If so, why can't you respond to the API request with your data in JSON? there is no concept of managed folder in the API node. Like in the other answer I gave you you will need to use the Dataiku API to go back to the Designer Node.

  • ssuhas76
    ssuhas76 Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Registered Posts: 31

    Let me rephrase this again. I am completely struck this issue.

    I have the below code in my API endpoint function which obviuosly will run outside of Dataiku.

    client = dataikuapi.DSSClient(host, apiKey)
    client._session.verify = False
    project = client.get_project("proj-name")

    managedfolder = project.get_managed_folder("folder-name")

    I need to export some data into a csv file which I need to store in the managed folder. How can i accomplish this?

Setup Info
    Tags
      Help me…