Skip to content

Commit

Permalink
Update createAllSupportedArrayTypes to include Date32Array.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevingurney committed Aug 29, 2023
1 parent 5750e2f commit b9b336d
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
matlabData = cell(numClasses, 1);

timeClasses = getTimeArrayClasses();
dateClasses = getDateArrayClasses();
numericArrayToMatlabTypeDict = getNumericArrayToMatlabDictionary();

for ii = 1:numel(classes)
Expand All @@ -54,6 +55,10 @@
matlabData{ii} = randomDurations(opts.NumRows);
cmd = compose("%s.fromMATLAB(matlabData{ii})", name);
arrowArrays{ii} = eval(cmd);
elseif ismember(name, dateClasses)
matlabData{ii} = randomDatetimes(opts.NumRows);
cmd = compose("%s.fromMATLAB(matlabData{ii})", name);
arrowArrays{ii} = eval(cmd);
else
error("arrow:test:SupportedArrayCase", ...
"Missing if-branch for array class " + name);
Expand Down Expand Up @@ -86,6 +91,10 @@
timeClasses = compose("arrow.array.Time%dArray", [32 64]);
end

function timeClasses = getDateArrayClasses()
timeClasses = compose("arrow.array.Date%dArray", 32);
end

function number = randomNumbers(numberType, numElements)
number = cast(randi(255, [numElements 1]), numberType);
end
Expand Down

0 comments on commit b9b336d

Please sign in to comment.