Skip to content

Commit

Permalink
Merge pull request #241 from datajoint/stage
Browse files Browse the repository at this point in the history
Add check for sparse blobs
  • Loading branch information
eywalker authored May 19, 2020
2 parents 853e2d2 + 243883e commit 875c894
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions +dj/Relvar.m
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,10 @@ function insert(self, tuples, command)
blobs{end+1} = char(v); %#ok<AGROW>
end
elseif header.attributes(i).isBlob
assert(~issparse(v), ...
'DataJoint:DataType:Mismatch', ...
'Sparse matrix in blob field `%s` is currently not supported', ...
header.attributes(i).name);
valueStr = sprintf('%s"{M}",', valueStr);
blobs{end+1} = v; %#ok<AGROW>
else
Expand Down Expand Up @@ -363,6 +367,10 @@ function update(self, attrname, value)
valueStr = '"{S}"';
value = {char(value)};
case header.attributes(ix).isBlob
assert(~issparse(value), ...
'DataJoint:DataType:Mismatch', ...
'Sparse matrix in blob field `%s` is currently not supported', ...
attrname);
valueStr = '"{M}"';
value = {value};
case header.attributes(ix).isNumeric
Expand Down

0 comments on commit 875c894

Please sign in to comment.