Skip to content

Commit

Permalink
Removes warning: "Passing literal json to 'read_json' is deprecated". (
Browse files Browse the repository at this point in the history
…#2450)

Co-authored-by: madtoinou <[email protected]>
Co-authored-by: Dennis Bader <[email protected]>
  • Loading branch information
3 people authored Jul 8, 2024
1 parent b6dfcfe commit e721b5e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion darts/timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
from collections import defaultdict
from copy import deepcopy
from inspect import signature
from io import StringIO
from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union

import matplotlib.axes
Expand Down Expand Up @@ -1247,7 +1248,7 @@ def from_json(
TimeSeries
The time series object converted from the JSON String
"""
df = pd.read_json(json_str, orient="split")
df = pd.read_json(StringIO(json_str), orient="split")
return cls.from_dataframe(
df, static_covariates=static_covariates, hierarchy=hierarchy
)
Expand Down

0 comments on commit e721b5e

Please sign in to comment.