How to access partitions

Options
Marie
Marie Registered Posts: 3 ✭✭✭✭

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.

Tagged:

Answers

  • Clément_Stenac
    Clément_Stenac Dataiker, Dataiku DSS Core Designer, Registered Posts: 753 Dataiker
    Options
    Hi,

    Is this happening in a preparation recipe ? These variables are only available in regular Python recipes.
  • Marie
    Marie Registered Posts: 3 ✭✭✭✭
    Options
    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.
  • Chris7777
    Chris7777 Registered Posts: 2 ✭✭✭
    Options

    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

  • Maggie
    Maggie Registered Posts: 1 ✭✭✭
    edited July 17
    Options

    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'
  • Chris7777
    Chris7777 Registered Posts: 2 ✭✭✭
    Options

    I think it depends on the version of dataiku

Setup Info
    Tags
      Help me…