datajoint-matlab
datajoint-matlab copied to clipboard
error when using matlab reserved words as attributes
The new implementation of table preview chokes when an attribute name is a reserved word in matlab. E.g.
>> lab.Paths
ans =
Object lab.Paths
:: ::
90 preview = struct2table(preview(1:min(end,maxRows)), 'asArray', true);
Error using matlab.internal.tabular.private.varNamesDim.makeValidName (line 433)
'global' is not a valid variable name.
Error in matlab.internal.tabular.private.varNamesDim/validateAndAssignLabels (line 311)
[newLabels,wasMadeValid] = obj.makeValidName(newLabels,exceptionMode);
Error in matlab.internal.tabular.private.tabularDimension/setLabels (line 173)
obj = obj.validateAndAssignLabels(newLabels,indices,fullAssignment,fixDups,fixEmpties,fixIllegal);
Error in matlab.internal.tabular.private.tabularDimension/createLike_impl (line 355)
obj = obj.setLabels(dimLabels,[]);
Error in matlab.internal.tabular.private.varNamesDim/createLike (line 70)
obj = obj.createLike_impl(dimLength,dimLabels);
Error in tabular/initInternals (line 207)
t.varDim = t.varDim.createLike(nvars,varnames); % error if invalid, duplicate, or empty
Error in table.init (line 327)
t = initInternals(t, vars, numRows, rowLabels, numVars, varnames);
Error in table.fromScalarStruct (line 318)
t = table.init(struct2cell(s)',n,{},p,vnames);
Error in struct2table (line 57)
t = table.fromScalarStruct(cell2struct(vars,fieldnames(s),2)); % cell -> scalarStruct -> table
Error in dj.internal.GeneralRelvar/disp (line 90)
preview = struct2table(preview(1:min(end,maxRows)), 'asArray', true);
where lab.Paths
is defined as
#
global : varchar(255) #
---
linux : varchar(255) #
windows : varchar(255) #
mac : varchar(255) #
location=null : varchar(255) #
^ or maybe 4.0
^ technically a non-specification