[dku.utils] - NameError: name 'dku' is not defined

Options
Tina_liaddana
Tina_liaddana Registered Posts: 9

Hello,

I tried to run a python recipe and I got the error: [dku.utils] - NameError: name 'dku' is not defined

Here is the full job log.

Thanks for your help

Answers

  • Turribeach
    Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 1,757 Neuron
    Options

    Can you please post your Python recipe code using a code block? (it's the </> icon in the toolbar). Thanks

  • Tina_liaddana
    Tina_liaddana Registered Posts: 9
    edited July 17
    Options
    # -*- coding: utf-8 -*-
    # LIBRAIRIES & PACKAGES
    import pandas as pd
    import numpy as np
    import warnings
    import dataiku
    from dataiku import pandasutils as pdu
    warnings.filterwarnings("ignore", category=pd.core.common.SettingWithCopyWarning) 
    
    from multi_class_analyse_drg import AnalyseDRG_multiplewindow
    
    #define parameters
    multi_scan_parameters = dataiku.get_custom_variables()
    print (multi_scan_parameters)
    print (type(multi_scan_parameters))
    for k, v in multi_scan_parameters.items():
        exec(f"{k} = v")
        
    
    my_analyse =  AnalyseDRG_multiplewindow("data_prepared")
    _ = [my_analyse.c_study(code,kind_of_date,
                            procedure = procedure,
                            list_windows = list_windows, 
                            N_last_days = N_last_days, 
                            alpha_scan=alpha_scan) 
          for code in my_analyse.list_code]
    
    df = my_analyse.res["c_study"]
    df = df[df[code]["suspicious_nitg"] > 0 and df[code]["results"]["n_tot"] > min_n_tot]
    
    # Write recipe outputs
    alertes = dataiku.Dataset("alertes")
    alertes.write_with_schema(df)
  • Turribeach
    Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 1,757 Neuron
    Options

    Your recipe is running in a kubernetes container which makes it harder to see the actual error. Can you try to run it in the DSS server to see if it works or gives an error?

  • Tina_liaddana
    Tina_liaddana Registered Posts: 9
    Options

    in order to run it in the dss server, what shall I do exaclty?

    is it to select the behavior as "None - use backend to execute"?

  • Turribeach
    Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 1,757 Neuron
    Options
  • Tina_liaddana
    Tina_liaddana Registered Posts: 9
    Options

    it gives the same error

Setup Info
    Tags
      Help me…