Job failed: Error in Python process: At line 100: <type 'exceptions.UnicodeEncodeError'>: ascii

Solved!
clu320
Level 1
Job failed: Error in Python process: At line 100: <type 'exceptions.UnicodeEncodeError'>: ascii

Hi Team,

When I run the command codes inside the Dataiku jupyter notebook everything is fine. However, when I tried to run the entire code recipe and build the dataset, it shows this error message below. I am just wondering can anyone help me with this? Thank you so much!

 
 

Capture.PNG

And here is my code for those error lines:

df = pd.read_csv(i,sep = '\t',skiprows=2,engine='python',encoding='utf-8',error_bad_lines=False)
master_table = read_file(df,master_table)

0 Kudos
1 Solution
RoyE
Dataiker

Hello,

Can you double check that the code environment that is being used in your notebook is the same that is being used for your recipe? 

By default, recipes will default to "inherit project default" which may be based on Python 2.X which has a few extra steps that you will need to explicitly state when encoding/decoding while in Python 3.X this is by default.

To check this setting, open the recipe's "Advanced" page and under "Python Environment", select the dropdown and select "Select an Environment" and choose the correct environment. 

Let me know if this resolves the issue.

Roy

View solution in original post

0 Kudos
2 Replies
RoyE
Dataiker

Hello,

Can you double check that the code environment that is being used in your notebook is the same that is being used for your recipe? 

By default, recipes will default to "inherit project default" which may be based on Python 2.X which has a few extra steps that you will need to explicitly state when encoding/decoding while in Python 3.X this is by default.

To check this setting, open the recipe's "Advanced" page and under "Python Environment", select the dropdown and select "Select an Environment" and choose the correct environment. 

Let me know if this resolves the issue.

Roy

0 Kudos
clu320
Level 1
Author

It works!

Thank you very much!!!

0 Kudos