You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "birschick-bq (via GitHub)" <gi...@apache.org> on 2024/11/28 22:22:13 UTC

[PR] feat(csharp/src/Drivers/Apache): make Apache driver tests inheritable [arrow-adbc]

birschick-bq opened a new pull request, #2341:
URL: https://github.com/apache/arrow-adbc/pull/2341

   Makes Apache driver tests inheritable.
   * Handles different drivers 
   * Handles driver property differences


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(csharp/src/Drivers/Apache): make Apache driver tests inheritable [arrow-adbc]

Posted by "birschick-bq (via GitHub)" <gi...@apache.org>.
birschick-bq commented on code in PR #2341:
URL: https://github.com/apache/arrow-adbc/pull/2341#discussion_r1868191294


##########
csharp/test/Apache.Arrow.Adbc.Tests/TestBase.cs:
##########
@@ -497,15 +476,20 @@ private static void ValidateBinaryArrayValue(Func<int, object?> expectedValues,
         /// <summary>
         /// Validates a single values for all results (in the batch).
         /// </summary>
-        /// <param name="value">The value to validate.</param>
         /// <param name="length">The length of the current batch/array.</param>
+        /// <param name="value">The value to validate.</param>
         /// <param name="getter">The getter function to retrieve the actual value.</param>
-        private static void ValidateValue(Func<int, object?> value, int length, Func<int, object?> getter, Int32Array? indexColumn = null)
+        /// <param name="indexColumn"></param>
+        private static void ValidateValue(int length, Func<int, object?> value, Func<int, object?> getter, Int32Array? indexColumn = null, Func<int, bool>? isNullEvaluator = default)
         {
             for (int i = 0; i < length; i++)
             {
                 int valueIndex = indexColumn?.GetValue(i) ?? i;
                 object? expected = value(valueIndex);
+                if (expected == null && isNullEvaluator != null)
+                {
+                    Assert.True(isNullEvaluator(i), "expecting actual value to be null");

Review Comment:
   Done. Good catch.



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(csharp/src/Drivers/Apache): make Apache driver tests inheritable [arrow-adbc]

Posted by "CurtHagenlocher (via GitHub)" <gi...@apache.org>.
CurtHagenlocher commented on code in PR #2341:
URL: https://github.com/apache/arrow-adbc/pull/2341#discussion_r1866792039


##########
csharp/test/Apache.Arrow.Adbc.Tests/TestBase.cs:
##########
@@ -497,15 +476,20 @@ private static void ValidateBinaryArrayValue(Func<int, object?> expectedValues,
         /// <summary>
         /// Validates a single values for all results (in the batch).
         /// </summary>
-        /// <param name="value">The value to validate.</param>
         /// <param name="length">The length of the current batch/array.</param>
+        /// <param name="value">The value to validate.</param>
         /// <param name="getter">The getter function to retrieve the actual value.</param>
-        private static void ValidateValue(Func<int, object?> value, int length, Func<int, object?> getter, Int32Array? indexColumn = null)
+        /// <param name="indexColumn"></param>
+        private static void ValidateValue(int length, Func<int, object?> value, Func<int, object?> getter, Int32Array? indexColumn = null, Func<int, bool>? isNullEvaluator = default)
         {
             for (int i = 0; i < length; i++)
             {
                 int valueIndex = indexColumn?.GetValue(i) ?? i;
                 object? expected = value(valueIndex);
+                if (expected == null && isNullEvaluator != null)
+                {
+                    Assert.True(isNullEvaluator(i), "expecting actual value to be null");

Review Comment:
   Should the test fail if `expected != null && !isNullEvaluator(i)`?



##########
csharp/src/Drivers/Apache/Apache.Arrow.Adbc.Drivers.Apache.csproj:
##########
@@ -6,6 +6,7 @@
 
   <ItemGroup>
     <PackageReference Include="ApacheThrift" Version="0.21.0" />
+    <PackageReference Include="System.Net.Http" Version="4.3.4" />

Review Comment:
   This will need to be reverted and/or the branch rebased as I've already checked this in as a separate fix.



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(csharp/src/Drivers/Apache): make Apache driver tests inheritable [arrow-adbc]

Posted by "birschick-bq (via GitHub)" <gi...@apache.org>.
birschick-bq commented on code in PR #2341:
URL: https://github.com/apache/arrow-adbc/pull/2341#discussion_r1868180308


##########
csharp/src/Drivers/Apache/Apache.Arrow.Adbc.Drivers.Apache.csproj:
##########
@@ -6,6 +6,7 @@
 
   <ItemGroup>
     <PackageReference Include="ApacheThrift" Version="0.21.0" />
+    <PackageReference Include="System.Net.Http" Version="4.3.4" />

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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(csharp/src/Drivers/Apache): make Apache driver tests inheritable [arrow-adbc]

Posted by "CurtHagenlocher (via GitHub)" <gi...@apache.org>.
CurtHagenlocher merged PR #2341:
URL: https://github.com/apache/arrow-adbc/pull/2341


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org