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

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


The following commit(s) were added to refs/heads/main by this push:
     new a315b961cd GH-49506: [CI][Python] Doctest fails when pyarrow._cuda 
absent (#49507)
a315b961cd is described below

commit a315b961cd6ab7b438d02a02f7aee3ff5c0c87c2
Author: Rok Mihevc <[email protected]>
AuthorDate: Fri Mar 13 16:23:34 2026 +0100

    GH-49506: [CI][Python] Doctest fails when pyarrow._cuda absent (#49507)
    
    ### Rationale for this change
    
    See https://github.com/apache/arrow/issues/49506.
    
    ### What changes are included in this PR?
    
    We skip cuda docstests in CI, since we don't build for CUDA.
    
    ### Are these changes tested?
    
    We currently see failing CI. That should go away.
    
    ### Are there any user-facing changes?
    
    Only to CI users.
    * GitHub Issue: #49506
    
    Lead-authored-by: Rok Mihevc <[email protected]>
    Co-authored-by: Raúl Cumplido <[email protected]>
    Signed-off-by: Rok Mihevc <[email protected]>
---
 python/pyarrow/conftest.py | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/python/pyarrow/conftest.py b/python/pyarrow/conftest.py
index 87c6bf91c8..234fb8ca79 100644
--- a/python/pyarrow/conftest.py
+++ b/python/pyarrow/conftest.py
@@ -215,6 +215,13 @@ except ImportError:
 
 # Doctest should ignore files for the modules that are not built
 def pytest_ignore_collect(collection_path, config):
+    def _cuda_is_available():
+        try:
+            import pyarrow.cuda  # noqa
+            return True
+        except ImportError:
+            return False
+
     if config.option.doctestmodules:
         # don't try to run doctests on the /tests directory
         if "/pyarrow/tests/" in str(collection_path):
@@ -239,11 +246,7 @@ def pytest_ignore_collect(collection_path, config):
                 return True
 
         if 'pyarrow/cuda' in str(collection_path):
-            try:
-                import pyarrow.cuda  # noqa
-                return False
-            except ImportError:
-                return True
+            return not _cuda_is_available()
 
         if 'pyarrow/fs' in str(collection_path):
             try:
@@ -257,6 +260,8 @@ def pytest_ignore_collect(collection_path, config):
             return True
         if "/pyarrow/_parquet_encryption" in str(collection_path):
             return True
+        if "/pyarrow/_cuda" in str(collection_path):
+            return not _cuda_is_available()
 
     return False
 

Reply via email to