Incorrect type casting in lisa.datautils.series_convert()
Describe the bug
Converting a series with values higher than 2^63 can lead to a negative value if a signed type is tried first due to Series.astype()
behavior:
import pandas as pd
import numpy as np
series = pd.Series([18446743558487338888])
print(series.astype('int64'))
print(series_convert(series, dtype='int64'))
This lambda in lisa.trace needs to be changed so that invalid casts raise an exception:
astype = lambda dtype: lambda x: x.astype(dtype, copy=False)