fix dataframe serializing

This commit is contained in:
Timothy Pogue
2022-09-01 23:15:03 -06:00
parent 00f35f4870
commit dccde88c83
6 changed files with 37 additions and 26 deletions
+2 -1
View File
@@ -269,7 +269,8 @@ def json_to_dataframe(data: str) -> pandas.DataFrame:
:returns: A pandas DataFrame from the JSON string
"""
dataframe = pandas.read_json(data)
dataframe['date'] = pandas.to_datetime(dataframe['date'], unit='ms', utc=True)
if 'date' in dataframe.columns:
dataframe['date'] = pandas.to_datetime(dataframe['date'], unit='ms', utc=True)
return dataframe