Summary
Hi Community!
I have a streamlit-ace editor in my code for json format. The input for this editor is a list of dictionaries, but when a user makes any changes, it converts to a string. I want it back as a list of dictionaries
Steps to reproduce
Code snippet:
content = st_ace(value=json.dumps(st.session_state.json_, indent=2), language="json", theme="clouds_midnight")
print(type(content), type(st.session_state.json_))
Expected behavior:
I want to receive it back as a list of dictionaries - [{},{},{}], instead I get โ[โ{},{},{}โ]โ
The bad part is, inside my json there are other string values, so this list becomes a list of 4 elements, maybe 5โฆ
Like, one string is -
{
โexpectation_typeโ: โexpect_column_values_to_be_in_setโ,
โmetaโ: {},
โkwargsโ: {
โvalue_setโ: [
โ41,-70โ,
โ42
second string is -
-70โ,
โ42
third string is -
-71โ,
โ42,-70โ,
โ42,-71โ,
โ42,-72โ,
โ42,-73โ,
"43
Actual behavior:
Before making any changes, type for st.session_state.json_ is <class โlistโ>, after running and saving editor content, itโs string.
I just need it back as the format it was in.
Is there any way to do that?
Thanks in advance!