PySUS
PySUS copied to clipboard
Comment dataframe decoding because of UnicodeDecodeError
I've encountered a bug while trying to download data for 'Dengue' in 2001 to 2008.
@esloch pointed that line 86 of file PySUS.pysus.online_data.__init__.py
was causing the error.
@luabida, did you run the tests after making this change?
@fccoelho I intend to permanently fix the issue #99 in next commits, although I also need this change on the epigraphhub_py PR. Please hold this PR until I fix the issue.
https://github.com/AlertaDengue/PySUS/blob/fe9def7b5959ec8e0c45472d1f51b64102582781/pysus/online_data/init.py#L86
NOTE: The line above is actually doing nothing, it decodes the DataFrame but is not further used bc has no variable instantiated.
https://github.com/AlertaDengue/PySUS/blob/fe9def7b5959ec8e0c45472d1f51b64102582781/pysus/online_data/init.py#L86
NOTE: The line above is actually doing nothing, it decodes the DataFrame but is not further used bc has no variable instantiated.
Maybe something like this:
table = pa.Table.from_pandas(
df.applymap(
lambda x: x.decode() if isinstance(x, bytes) else x
)
)
Waiting for review
@esloch
LGTM!