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
 

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โ€™eฬcran 2021-05-18 aฬ€ 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

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โ€™eฬcran 2021-05-19 aฬ€ 09.44.34.png

Mattsco
0 Kudos