How to access partitions

Marie
Level 1
How to access partitions

Hello,



i want to add a variable which comes from partitioning to the table. 



So I am using the function in my python script:



dataiku.dku_flow_variables["DKU_DST_id"]



but getting the error




AttributeError: 'module' object has no attribute 'dku_flow_variables'


How to access the variable from which the partitioned are made?



Thanks.

0 Kudos
5 Replies
Clรฉment_Stenac
Hi,

Is this happening in a preparation recipe ? These variables are only available in regular Python recipes.
0 Kudos
Marie
Level 1
Author
It is a normal python recipe with a Input dataset and an output dataset. I can add the variable code by manually clicking on the variable on the left side after I validated the code successfully.
0 Kudos
Chris7777
Level 1

Hello,
I have the same problem. Did you finally find a solution. If yes, can you please share it with me?
Any solutions from another person would be great
Thanks in advance

0 Kudos
Maggie
Level 1

Hello, I am also wondering if there is a working solution. I am using Dataiku 8.0.x, i have the same use case: trying to access partition information from within a python recipe. Getting the same error:

 

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-51-a0ae99823750> in <module>
      1 baseline_metric_tracker=[]
----> 2 part_name= dataiku.dku_flow_variables["DKU_DST_partition"]

AttributeError: module 'dataiku' has no attribute 'dku_flow_variables'
0 Kudos
Chris7777
Level 1

I think it depends on the version of dataiku

0 Kudos