Skip to content

Commit

Permalink
1. Remove custom display for Date32Array MATLAB class.
Browse files Browse the repository at this point in the history
2. Add Date32 case to `arrow.type.traits.traits` function.

Co-authored-by: Sarah Gilmore <[email protected]>
  • Loading branch information
kevingurney and sgilmore10 committed Aug 25, 2023
1 parent 6f9e755 commit 0fa90f2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 34 deletions.
34 changes: 0 additions & 34 deletions matlab/src/matlab/+arrow/+array/Date32Array.m
Original file line number Diff line number Diff line change
Expand Up @@ -81,38 +81,4 @@
end
end

methods (Access=protected)

function displayScalarObject(obj)
maxLength = 20;
openBracket = "[";
closeBracket = "]";
indent = " ";
data = obj.toMATLAB();
data.Format = "yyyy-MM-dd";
% Abbreviate with ellipsis if more than maxLength elements.
if obj.Length > maxLength
firstTenElements = data(1:10);
lastTenElements = data(end-9:end);
ellipsis = "...";
beforeEllipsis = indent + strjoin(string(firstTenElements), "," + newline + indent) + ",";
afterEllipsis = indent + strjoin(string(lastTenElements), "," + newline + indent);
str = ...
openBracket + newline + ...
beforeEllipsis + newline + ...
indent + ellipsis + newline + ...
afterEllipsis + newline + ...
closeBracket;
disp(str);

else
str = openBracket + newline + ...
indent + strjoin(string(data), "," + newline + indent) + newline + ...
closeBracket;
disp(str);
end
end

end

end
2 changes: 2 additions & 0 deletions matlab/src/matlab/+arrow/+type/+traits/traits.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
typeTraits = Time32Traits();
case ID.Time64
typeTraits = Time64Traits();
case ID.Date32
typeTraits = Date32Traits();
otherwise
error("arrow:type:traits:UnsupportedArrowTypeID", "Unsupported Arrow type ID: " + type);
end
Expand Down

0 comments on commit 0fa90f2

Please sign in to comment.