Skip to content

Commit

Permalink
fixed sql encoder
Browse files Browse the repository at this point in the history
  • Loading branch information
KS-HTK committed Feb 19, 2024
1 parent eebf7a1 commit 0158729
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pandapower/io_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,17 @@ def to_dict_of_dfs(net, include_results=False, include_std_types=True, include_p
elif "object" in value.columns:
columns = [c for c in value.columns if c != "object"]
tab = value[columns].copy()
tab["object"] = value["object"].apply(lambda x: json.dumps(x, cls=PPJSONEncoder,
indent=2))
tab["object"] = value["object"].apply(lambda x: json.dumps(x, cls=PPJSONEncoder, indent=2))
tab = tab[value.columns]
if "recycle" in tab.columns:
tab["recycle"] = tab["recycle"].apply(json.dumps)
dodfs[item] = tab
elif "geo" in value.columns:
columns = [c for c in value.columns if c != "geo"]
tab = value[columns].copy()
tab["geo"] = value["geo"].apply(lambda x: json.dumps(x, cls=PPJSONEncoder, indent=2))
tab = tab[value.columns]
dodfs[item] = tab
else:
dodfs[item] = value
# save dtypes
Expand Down

0 comments on commit 0158729

Please sign in to comment.