Skip to content

Commit

Permalink
handling data encoding latin1
Browse files Browse the repository at this point in the history
  • Loading branch information
jgjuara committed Jul 2, 2024
1 parent a2e7a28 commit 43fe6e1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion data_transformers/consumer/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ def create_uploader(gid, data, transformer, path, repo):
return LazyAction(lambda *args, **kwargs: print(f'{gid} skipped (data not found).'))

data_content = get_data_retry(data, on_retry=data.update)
data_content = data_content.decode('utf-8')
try:
data_content = data_content.decode('utf-8')
except UnicodeDecodeError:
data_content = data_content.decode('latin-1')

df = pd.read_csv(StringIO(data_content))

Expand Down

0 comments on commit 43fe6e1

Please sign in to comment.