Python Recipe error

SourabhJ
Level 2
Python Recipe error

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

0 Kudos
4 Replies
MiguelangelC
Dataiker

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.

0 Kudos
SourabhJ
Level 2
Author

Hi,

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

0 Kudos
SourabhJ
Level 2
Author

Hi,

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

Thanks,

Sourabh

0 Kudos
Turribeach

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.

 

Labels

?

Setup info

?
A banner prompting to get Dataiku