Skip to content

Commit

Permalink
deprecation fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
vogt31337 committed Sep 7, 2023
1 parent 5592ba1 commit 9478c80
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pandapower/io_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from pandapower.auxiliary import _preserve_dtypes
import networkx
import numpy
from io import StringIO
import pandas as pd
from networkx.readwrite import json_graph
from numpy import ndarray, generic, equal, isnan, allclose, any as anynp
Expand Down Expand Up @@ -506,7 +507,11 @@ def DataFrame(self):
column_name = self.d.pop('column_name', None)
column_names = self.d.pop('column_names', None)

df = pd.read_json(self.obj, precise_float=True, convert_axes=False, **self.d)
obj = self.obj
if type(obj) == str:
obj = StringIO(obj)

df = pd.read_json(obj, precise_float=True, convert_axes=False, **self.d)

if not df.shape[0] or self.d.get("orient", False) == "columns":
try:
Expand Down

0 comments on commit 9478c80

Please sign in to comment.