Python Recipe error

Sourabh
Sourabh Dataiku DSS Core Designer, Dataiku DSS Adv Designer, Registered Posts: 8 ✭✭✭

Hi,

I have created a python recipe with Input & Output as Managed Folder, please find below SS for the same.

So when i am trying to building this recipe its showing me the Name error, i will share the diagnostics for it with this ticket.


Operating system used: Windows


Operating system used: Windows

Tagged:

Answers

  • Miguel Angel
    Miguel Angel Dataiker, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 118 Dataiker
    edited July 17

    Hi,

    The error is telling us a variable/function is being called before being declared:

    NameError: name 'GE_DataSourceCreation' is not defined

    In Line 78 of your script there is a call for 'GE_DataSourceCreation'. However, this function's declaration starts at line 84. The general rule in Python is that a function should be defined before its usage. Please move that function's declaration block further above in the code.

  • Sourabh
    Sourabh Dataiku DSS Core Designer, Dataiku DSS Adv Designer, Registered Posts: 8 ✭✭✭

    Hi,

    Thanks Let me try that and get back to you if needed help.

  • Sourabh
    Sourabh Dataiku DSS Core Designer, Dataiku DSS Adv Designer, Registered Posts: 8 ✭✭✭

    Hi,

    I tried your solution with moving function declaration further above in the code, still experiencing same error.

    Thanks,

    Sourabh

  • Turribeach
    Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,088 Neuron

    The function is still below the code:

    Screenshot 2023-08-22 at 21.16.04.png

    This function should be moved to the top of the recipe. Please avoid posting diagnostics files here as they can have some confidential information. I would suggest you remove the ones you posted on this thread already.

Setup Info
    Tags
      Help me…