0 votes

I'm currently writing a Python function with lots of inputs. I'd like to list these inputs from within the recipe to avoid to declare them manually. These are the two solutions I tried :

  1. I tried to retrieve the recipe inputs using the API client. However, instanciating ```dataiku.api_client()``` into a Python recipe fails with a permission error later in the process.
  2. I tried to parse flow variables (from ```dataiku.dku_flow_variables```), but the ```DKU_LOCATION``` variable cannot differentiate inputs and outputs of the recipe.

Is there a third way I didn't see?



Usually there are ways to refactor the flow to avoid having too many inputs. Are you dealing with daily data? Or identical data for multiple entities that may be added over time?
Unfortunately, I cannot refactor the flow and I have to use a Python recipe.

(Full dislaimer : I built this recipe as a makeshift replacement for the stack recipe, since the later does not support "Missing partitions as empty" for mono-partitionned datasets but this is another topic).
Alternatively, could you put all files in one folder, and then read that folder using Python? Adding inputs to an existing recipe cannot be done from the recipe itself, but you could have it in a Python scenario step.
Alright, thanks Alex! I'll see what I can do.
Hi, Have you been able to design a solution? If so, do you mind sharing it as an answer? If not, please let me know if we can help.
Hi Alex, I sticked with the second solution, which is hacky but satisfying at the moment. Let me know if you introduce new flow variables in a next release!

Please log in or register to answer this question.

1,296 questions
1,325 answers
11,862 users

┬ęDataiku 2012-2018 - Privacy Policy