Merge "Omaha #4982 - Revert "Omaha #4982 Force matching datatypes when replacing data."" into omaha_16.2.1

Former-commit-id: 5e71ed8a25db1c6027094fc95d79970f0ad9127a
This commit is contained in:
Nate Jensen 2015-10-19 16:46:05 -05:00 committed by Gerrit Code Review
commit 6edb776ae5

View file

@ -45,7 +45,6 @@
# Aug 20, 2015 DR 17726 mgamazaychikov Remove __doMakeReadable method
# Sep 14, 2015 4868 rjpeter Updated writePartialHDFData to create the dataset if
# it doesn't exist.
# Oct 15, 2015 4982 nabowle Verify datatypes match when replacing data.
#
import h5py, os, numpy, pypies, re, logging, shutil, time, types, traceback
@ -191,8 +190,6 @@ class H5pyDataStore(IDataStore.IDataStore):
indices.append(long(0))
ss['index'] = indices
elif storeOp == 'REPLACE' or storeOp == 'OVERWRITE':
if ds.dtype != data.dtype:
raise StorageException("Cannot " + storeOp + " data of type " + ds.dtype.name + " with data of type " + data.dtype.name + ".")
if ds.shape != data.shape:
ds.resize(data.shape)
ds[()] = data
@ -292,8 +289,6 @@ class H5pyDataStore(IDataStore.IDataStore):
if dataset in group:
ds=group[dataset]
ss['op'] = 'REPLACE'
if ds.dtype != data.dtype:
raise StorageException("Cannot REPLACE data of type " + ds.dtype.name + " with data of type " + data.dtype.name + ".")
else:
if maxSizes is None:
raise StorageException('Dataset ' + dataset + ' does not exist for partial write. MaxSizes not specified to create initial dataset')