Hi! I'm having an issue with the <plotly.JSONDatas...
# questions
j
Hi! I'm having an issue with the plotly.JSONDataset. Saving a figure is working well. But when loading the same figure I get this error:
'utf-8' codec can't decode byte 0xe8 in position 6570: invalid continuation byte
Saving and loading the figure manually via plotly.io.write_json and plotly.io.read_json is working though. I also tried to use plotly.io.from_json via fsspec and that was working as well without issues. I had a look at the source code for the plotly.JSONDataset and I found a hardcoded "utf-8" in line 153. I experimented changing this to "latin-1" and then loading the figures worked. Is there a reason why "utf-8" is hardcoded here? Could this be a parameter to be set in the catalog definition? I also tried to set different encoding options via the catalog parameters fs_args and load_args but nothing worked.
🤔 1
Okay, I finally managed to go around this issue by adding these options to the catalog entry:
Copy code
fs_args:
  open_args_save:
    encoding: utf-8
Don't know why it was not saving it properly in utf-8 before.
e
Hello Jan, thanks for sharing your solution! In my understanding, it should work even if not provide an
encoding
argument as by default it’s should be
utf-8
https://docs.kedro.org/en/stable/data/data_catalog.html#load-and-save-arguments https://filesystem-spec.readthedocs.io/en/latest/api.html#fsspec.open We might need to double-check what value is used by default in case if not provide
open_args_save.encoding
. Would you mind opening an issue?
j
Okay will create an issue for that. In the general kedro repo or the plugins one?
e
Plugins, thank you!
👍 1