This is an automated email from the ASF dual-hosted git repository.

curth pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-dotnet.git


The following commit(s) were added to refs/heads/main by this push:
     new def3031  chore: Disable C interop tests when an incompatible version 
of Python is installed (#152)
def3031 is described below

commit def30316cbcbf40e4c1cd420f59e679fd36e1ba0
Author: Curt Hagenlocher <[email protected]>
AuthorDate: Wed Oct 29 07:33:52 2025 -0700

    chore: Disable C interop tests when an incompatible version of Python is 
installed (#152)
    
    ## What's Changed
    
    This disables the C interop tests for now as they're failing due to a
    pythonnet incompatibility with Python 3.14. These should be reenabled
    before shipping a new release, hopefully by being able to take a new
    version of pythonnet.
---
 test/Apache.Arrow.Tests/CDataInterfacePythonTests.cs | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/test/Apache.Arrow.Tests/CDataInterfacePythonTests.cs 
b/test/Apache.Arrow.Tests/CDataInterfacePythonTests.cs
index 6dfb522..e7cff35 100644
--- a/test/Apache.Arrow.Tests/CDataInterfacePythonTests.cs
+++ b/test/Apache.Arrow.Tests/CDataInterfacePythonTests.cs
@@ -35,6 +35,8 @@ namespace Apache.Arrow.Tests
         {
             public bool Initialized { get; }
 
+            public bool VersionMismatch { get; }
+
             public PythonNet()
             {
                 bool pythonSet = 
Environment.GetEnvironmentVariable("PYTHONNET_PYDLL") != null;
@@ -44,7 +46,17 @@ namespace Apache.Arrow.Tests
                     return;
                 }
 
-                PythonEngine.Initialize();
+                try
+                {
+                    PythonEngine.Initialize();
+                }
+                catch (NotSupportedException e) when 
(e.Message.Contains("Python ABI ") && e.Message.Contains("not supported"))
+                {
+                    // An unsupported version of Python is being used
+                    Initialized = false;
+                    VersionMismatch = true;
+                    return;
+                }
 
                 if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) &&
                     PythonEngine.PythonPath.IndexOf("dlls", 
StringComparison.OrdinalIgnoreCase) < 0)
@@ -66,6 +78,8 @@ namespace Apache.Arrow.Tests
         {
             if (!pythonNet.Initialized)
             {
+                Skip.If(pythonNet.VersionMismatch, "VM has incompatible 
version of Python installed; skipping C Data Interface tests.");
+
                 bool inCIJob = 
Environment.GetEnvironmentVariable("GITHUB_ACTIONS") == "true";
                 bool inVerificationJob = 
Environment.GetEnvironmentVariable("TEST_CSHARP") == "1";
 

Reply via email to