LLNL / hatchet

Graph-indexed Pandas DataFrames for analyzing hierarchical performance data
https://llnl-hatchet.readthedocs.io
MIT License
27 stars 18 forks source link

Change "nid" Casted Value in caliper_native_reader to np.int64 #118

Closed michaelmckinsey1 closed 5 months ago

michaelmckinsey1 commented 6 months ago

Summary

While working with GraphFrame.to_hdf() I noticed that the pytables backend does not support the current datatype of the nid column, causing:

TypeError: objects of type ``IntegerArray`` are not supported in this context, sorry; supported objects are: NumPy array, record or scalar; homogeneous list or tuple, integer, float, complex or bytes

Most datatypes in Pandas columns get casted to Numpy datatypes . We needed to use pd.Int64Dtype() for time series data since np.int64 does not support NaN values. By casting the "nid" column to np.float64 instead of pd.Int64Dtype(), the issue is fixed with pytables and we can support NaN values for time series.