You now have until September 15th to submit your use case or success story to the 2022 Dataiku Frontrunner Awards!ENTER YOUR SUBMISSION

Change 'path in bucket' for S3 managed folder using code

psvnm
Level 2
Change 'path in bucket' for S3 managed folder using code

Hi there,

I wanted to change the path for S3 managed folder using code rather than manual. Please suggest further.

0 Kudos
1 Reply
RoyE
Dataiker
Dataiker

Hi!

This can be done using the dataikuapi package as seen below.
You will need to fill in the required variables with your environment specific information.

 

import dataikuapi
host = "" #hosturl 
key = '' #user API key
client = dataikuapi.DSSClient(host, key)
project = client.get_project(projectKey)
dataset = project.get_dataset(datasetName)

getSettings = dataset.get_settings() 
getSettings.get_raw_params()['path']='/test' #s3 bucket path
getSettings.save() #save changes

 

0 Kudos