HimanshuSPaul
HimanshuSPaul

Reputation: 316

dbt Error : Encountered an error: 'utf-8' codec can't decode byte 0xa0 in position 441: invalid start byte

I have upgraded my dbt version to 1.0.0 yesterday night and ran few connection test. It went well . Now when i am running the my first dbt example model , i am getting below error , even though i have not changed any code in this default example model.

Same error i am getting while running dbt seed command also for a csv dataset . The csv is utf-8 encoded and no special character in it . I am using python 3.9

Could anyone suggest what is the issue ?

Below is my first dbt model sql enter image description here

enter image description here

Upvotes: 1

Views: 3423

Answers (2)

HimanshuSPaul
HimanshuSPaul

Reputation: 316

After lots of back and forth, I figured out the issue. This is more like fundamental concept issue.

Every time we execute dbt run, dbt will scan through the entire project directory ( including seeds directory even though it is not materializing the seed ) [Attached screenshot below].

If it finds any csv it also parsed it .

enter image description here

In case of above error, I had a csv file which looks follows :

enter image description here

If we see the highlighted line it contains some symbol character which dbt (i.e python) was not able to parse it causing above error.

This symbol was not visible earlier in excel or notepad++.

Data In Notepad++

Data In Excel

It could be the issue with Snowflake python connector that @PeterH has pointed out .

As temporary solution , for now we are manually removing these character from Data file.

Upvotes: 2

PeterH
PeterH

Reputation: 121

I’d leave this as a comment but I don’t have the rep yet…

This appears to be related to a recently-opened issue.

https://github.com/dbt-labs/dbt-snowflake/issues/66

Apparently it’s something to do with the snowflake python adapter.

Since you’re seeing the error from a different context, it might be helpful for you to post in that issue that you’re seeing this outside of query preview.

Upvotes: 0

Related Questions