fix: json format detection in deserialization of pandas dataframe made

more general and less dependant on the json implementation.
This commit is contained in:
Fabian Joswig 2022-07-04 14:47:01 +01:00
parent cc9f47c686
commit dc45894b64

View file

@ -104,7 +104,7 @@ def deserialize_df(df, auto_gamma=False):
if df[column][0].startswith(b"\x1f\x8b\x08\x00"):
df[column] = df[column].transform(lambda x: gzip.decompress(x).decode('utf-8'))
if isinstance(df[column][0], str):
if df[column][0][:20] == '{"program":"pyerrors':
if '"program":' in df[column][0][:20]:
df[column] = df[column].transform(lambda x: import_json_string(x, verbose=False))
if auto_gamma is True:
df[column].apply(lambda x: x.gamma_method())