change df serialization to avoid mem leak

This commit is contained in:
Timothy Pogue
2022-11-17 11:59:03 -07:00
parent 0a7f4fd3cc
commit 875e9ab447
3 changed files with 12 additions and 4 deletions

View File

@@ -101,7 +101,7 @@ def json_deserialize(message):
:param message: The message to deserialize
"""
def json_to_dataframe(data: str) -> pandas.DataFrame:
dataframe = pandas.read_json(data, orient='split')
dataframe = pandas.DataFrame.from_dict(data, orient='tight')
if 'date' in dataframe.columns:
dataframe['date'] = pandas.to_datetime(dataframe['date'], unit='ms', utc=True)