Do you know the History of Data Science? READ MORE

Get the partition variable in python recipe

subhash
Level 2
Get the partition variable in python recipe

Hi,

I have a dataset in dataiku which is partitioned, I am looking for tips on how I can get the partition value in python which is set as part of running the recipe.

See screenshot attached for reference. Basically i'm trying to access the partition variable in code

0 Kudos
3 Replies
Mattsco
Dataiker
Dataiker
 

Hi Subhash, 

In the python you can use: 

dataiku.dku_flow_variables["DKU_DST_curr_date"]

You can see available variables on the left panel from the python recipe and click on it to insert the code. 

Capture d’écran 2021-05-18 à 20.12.15.png

Mattsco
0 Kudos
subhash
Level 2
Author

Thanks @Mattsco but the variables it's disabled and I can't figure out a way to add a variable. All I want is to pick the curr_date i set as partition to process.

Thanks for your help

0 Kudos
Mattsco
Dataiker
Dataiker

Hi Subhash, 

It's not disabled, it says: "Validate your code to get the list of substitution variables."
So you must click on the validate button, on the left side of the RUN button, to get it. 🙂

Capture d’écran 2021-05-19 à 09.44.34.png

Mattsco
0 Kudos
A banner prompting to get Dataiku DSS