Global variables list converted differently in Recipes

hasnunhisyam
Level 1
Global variables list converted differently in Recipes

Hi,

 

Im using global variable to get the list of country as below:

Global Variable

{
"var_country_dummy": [
"malaysia",
"singapore"
]}

Python call the variable

countryArray = dataiku.get_custom_variables(typed = True)["var_country_dummy"]

 

When i ran the script in jupyter Notebook, the list looks like this and this is what i want.

['malaysia', 'singapore']

 

When i save into recipes, then build the flow, the list looks like this (log):

'm' , 'a' , 'l' , 'a' , 'y' , 's' , 'i' , 'a' , ',' , 's' , ' i' , 'n' , 'g' , 'a' , 'p' , 'o' , 'r' , 'e'

 

Any idea how to fix this?

0 Kudos
6 Replies
Clément_Stenac
Dataiker

Hi,

We do not reproduce this behavior. Could you please attach a screenshot of your variables screen, of your code, and of its output ?

0 Kudos
hasnunhisyam
Level 1
Author

This is Global Variable:

hasnunhisyam_0-1580870304351.png

SourceCode in Notebook and recipes:

hasnunhisyam_3-1580870537455.png

Output in Notebook:

hasnunhisyam_2-1580870498418.png

Output in Recipes (log):

hasnunhisyam_4-1580870769581.png

 

As you can see, same code will produce 2 different output in notebook and recipes.

 

 

 

 

 

 

 

0 Kudos
hasnunhisyam
Level 1
Author

Still no update here. But as per workaround, I just need to define the list in script itself, no need to use global variable.

0 Kudos
Clément_Stenac
Dataiker

Hi,

Thanks for the details. We confirm that at the moment, there is a difference in behavior. We're looking into the best way to fix it going forward.

0 Kudos
hasnunhisyam
Level 1
Author
Thank you
0 Kudos
Marija
Level 1

Hi, is there any update for this? Thanks , Marija

0 Kudos