Cannot use a managed folder as an input of a python recipe created from python code using builder

AnnaZ
Level 2
Cannot use a managed folder as an input of a python recipe created from python code using builder

Hi team,

I currently encountered an urgent issue with our project automation pipeline. In a Python code recipe, I used builder to create a new python recipe, and have added a dataset as input, 3 new datasets as output. In order to save some model objects to a managed folder, I need to add an existing folder "Pickle_Files" as input of the newly created python recipe. (I can't add the folder through the UI, because all the steps and files are automatically generated by the previous python script).

I didn't have issues when I used files as inputs. So is there a way to add a managed folder as input of a python recipe in code?

Thanks,

Anna


Operating system used: Mac

0 Kudos
6 Replies
AnnaZ
Level 2
Author

When I created a new managed folder in the python code, moved it to the current working zone, and then tried to use this new folder as input of another new python recipe, it showed a new error:

code:

new_folder = project.create_managed_folder("test")

new_folder.move_to_zone("vdVhYpH")

builder.with_input(new_folder)

error:

TypeError: Object of type DSSManagedFolder is not JSON serializable

 

0 Kudos
AnnaZ
Level 2
Author

I found the solution....

0 Kudos
CoreyS
Dataiker Alumni

Hey, @AnnaZ that's great! Would it be possible to share what your solution is? That way if someone else has a similar issue in the future they would be able to utilize your solution for their own benefit. Thanks!

Looking for more resources to help you use Dataiku effectively and upskill your knowledge? Check out these great resources: Dataiku Academy | Documentation | Knowledge Base

A reply answered your question? Mark as โ€˜Accepted Solutionโ€™ to help others like you!
0 Kudos
pnw_ds
Level 2

Same problem! Wish the solution was shared. 

0 Kudos
Turribeach

Please start a new thread, post your code and the error you get and we will help you. 

0 Kudos
pnw_ds
Level 2

No need, I just had to make sure the dataset name in the input/output tab matched what was in my python recipe.