sgilmore10 commented on code in PR #36978:
URL: https://github.com/apache/arrow/pull/36978#discussion_r1283367717


##########
matlab/test/arrow/array/tTimestampArray.m:
##########
@@ -134,47 +133,54 @@ function TestInferNulls(testCase, TimeUnit, TimeZone)
         end
 
         function TestValidNVPair(testCase, TimeUnit, TimeZone)
-            import arrow.array.TimestampArray
 
             dates = datetime(2023, 6, 22, TimeZone=TimeZone) + days(0:4);
             dates([2 4]) = NaT;
             
             % Supply the Valid name-value pair as vector of indices.
-            arrowArray = arrow.array.TimestampArray(dates, TimeUnit=TimeUnit, 
Valid=[1 2 5]);
+            arrowArray = testCase.ArrowArrayConstructor(dates, 
TimeUnit=TimeUnit, Valid=[1 2 5]);
             testCase.verifyEqual(arrowArray.Valid, [true; true; false; false; 
true]);
             expectedDates = dates';
             expectedDates(2) = getFillValue(TimeZone);
             expectedDates([3 4]) = NaT;
             testCase.verifyEqual(toMATLAB(arrowArray), expectedDates);
 
             % Supply the Valid name-value pair as a logical scalar.
-            arrowArray = arrow.array.TimestampArray(dates, TimeUnit=TimeUnit, 
Valid=false);
+            arrowArray = testCase.ArrowArrayConstructor(dates, 
TimeUnit=TimeUnit, Valid=false);
             testCase.verifyEqual(arrowArray.Valid, [false; false; false; 
false; false]);
             expectedDates(:) = NaT;
             testCase.verifyEqual(toMATLAB(arrowArray), expectedDates);
         end
 
         function ErrorIfNonVector(testCase)
-            import arrow.array.TimestampArray
 
             dates = datetime(2023, 6, 2) + days(0:11);
             dates = reshape(dates, 2, 6);
-            fcn = @() TimestampArray(dates);
-            testCase.verifyError(fcn, "MATLAB:expectedVector");
+            fcn = @() testCase.ArrowArrayConstructor(dates);
+            testCase.verifyError(fcn, "arrow:array:InvalidShape");
 
             dates = reshape(dates, 3, 2, 2);
-            fcn = @() TimestampArray(dates);
-            testCase.verifyError(fcn, "MATLAB:expectedVector");
+            fcn = @() testCase.ArrowArrayConstructor(dates);
+            testCase.verifyError(fcn, "arrow:array:InvalidShape");
         end
 
         function EmptyDatetimeVector(testCase)
             import arrow.array.TimestampArray
 
             dates = datetime.empty(0, 0);
-            arrowArray = TimestampArray(dates);
+            arrowArray = testCase.ArrowArrayConstructor(dates);
+            testCase.verifyEqual(arrowArray.Length, int64(0));
+            testCase.verifyEqual(arrowArray.Valid, logical.empty(0, 1));
+            testCase.verifyEqual(toMATLAB(arrowArray), datetime.empty(0, 1));
+
+            % test with ND empty array

Review Comment:
   done.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to