Wrapped json strings with StringIO to address deprecation warnings
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from typing import Any, Dict
|
||||
from matplotlib import pyplot as plt
|
||||
from io import StringIO
|
||||
import pandas as pd
|
||||
from .common import common_input_types
|
||||
from .util import plot_post_steps
|
||||
@@ -49,7 +50,7 @@ class MPLBar:
|
||||
tuple: A tuple containing the image tensor representation of the plot.
|
||||
"""
|
||||
# Deserialize JSON string to DataFrame
|
||||
df = pd.read_json(dataframe_json)
|
||||
df = pd.read_json(StringIO(dataframe_json))
|
||||
|
||||
# Create the plot
|
||||
fig, ax = plt.subplots()
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
from typing import Any, Dict
|
||||
from matplotlib import pyplot as plt
|
||||
from io import StringIO
|
||||
import pandas as pd
|
||||
from .common import common_input_types
|
||||
from .util import plot_post_steps
|
||||
@@ -49,7 +50,7 @@ class MPLLine:
|
||||
tuple: A tuple containing the image tensor representation of the plot.
|
||||
"""
|
||||
# Deserialize JSON string to DataFrame
|
||||
df = pd.read_json(dataframe_json)
|
||||
df = pd.read_json(StringIO(dataframe_json))
|
||||
|
||||
# Create the plot
|
||||
fig, ax = plt.subplots()
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
from typing import Any, Dict
|
||||
from matplotlib import pyplot as plt
|
||||
from io import StringIO
|
||||
import pandas as pd
|
||||
from .common import common_input_types
|
||||
from .util import plot_post_steps
|
||||
@@ -49,7 +50,7 @@ class MPLScatter:
|
||||
tuple: A tuple containing the image tensor representation of the plot.
|
||||
"""
|
||||
# Deserialize JSON string to DataFrame
|
||||
df = pd.read_json(dataframe_json)
|
||||
df = pd.read_json(StringIO(dataframe_json))
|
||||
|
||||
# Create the plot
|
||||
fig, ax = plt.subplots()
|
||||
|
||||
Reference in New Issue
Block a user