util: coerce float32 series into float64 series
2 files changed, 5 insertions(+), 3 deletions(-)

M test/test_tsio.py
M tshistory/util.py
M test/test_tsio.py +2 -2
@@ 80,8 80,8 @@ def test_float32_dtype(engine, tsh):
         'index_dtype': '|M8[ns]',
         'index_type': 'datetime64[ns, UTC]',
         'tzaware': True,
-        'value_dtype': '<f4',
-        'value_type': 'float32'
+        'value_dtype': '<f8',
+        'value_type': 'float64'
     }
 
 

          
M tshistory/util.py +3 -1
@@ 394,9 394,11 @@ def unpack_history(bytestring):
     return metadata, hist
 
 
+TO64 = (np.dtype('int'), np.dtype('float32'))
+
 def num2float(pdobj):
     # get a Series or a Dataframe column
-    if str(pdobj.dtype).startswith('int'):
+    if pdobj.dtype in TO64:
         return pdobj.astype('float64')
     return pdobj