How to change a file name while writing file in S3 or exporting in managed folder using dataiku

Options
pritam003
pritam003 Registered Posts: 8 ✭✭✭✭

Hi Team

can you please let us know how to change file name

  • while writing in S3
  • exporting it to a managed folder.

regards,

pritam

Tagged:

Best Answer

  • Alexandru
    Alexandru Dataiker, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 1,209 Dataiker
    Answer ✓
    Options

    Hi @pritam003
    ,

    Changing the file name when using the Visual Export to Folder recipe is not possible.

    You can use Python recipe and read/write APIs. Create a python with managed folder ( backed on S3) as the output.

    import dataikuimport pandas as pd, numpy as npfrom dataiku import pandasutils as pdumanaged_folder_id = "URKU7Oqb"# Read dataset convert dfmy_dataset = dataiku.Dataset("customers_labeled_prepared")df = my_dataset.get_dataframe()# Write recipe outputsoutput_folder = dataiku.Folder(managed_folder_id)output_folder.upload_stream("some_name.csv", df.to_csv(index=False).encode("utf-8"))

Answers

Setup Info
    Tags
      Help me…