jorisvandenbossche commented on a change in pull request #11688:
URL: https://github.com/apache/arrow/pull/11688#discussion_r764646687



##########
File path: python/pyarrow/_dataset.pyx
##########
@@ -75,6 +70,59 @@ def _get_orc_fileformat():
     return _orc_fileformat
 
 
+_dataset_pq = False
+
+
+def _get_parquet_classes():
+    """
+    Import Parquet class files on first usage (to avoid circular import issue
+    when `pyarrow._dataset_parquet` would be imported first)
+    """
+    global _dataset_pq
+    if _dataset_pq is False:
+        try:
+            import pyarrow._dataset_parquet as _dataset_pq
+        except ImportError:
+            _dataset_pq = None
+
+
+def _get_parquet_symbol(name):
+    _get_parquet_classes()
+    return _dataset_pq and getattr(_dataset_pq, name)
+
+
+def _get_parquet_fileformat():
+    """
+    Import ParquetFileFormat on first usage (to avoid circular import issue
+    when `pyarrow._dataset_parquet` would be imported first)
+    """
+    return _get_parquet_symbol('ParquetFileFormat')

Review comment:
       Since those functions are each only used once, _could_ also use 
`_get_parquet_symbol("ParquetFileFormat")` directly below instead of the 
`_get_parquet_fileformat()` indirection

##########
File path: .travis.yml
##########
@@ -132,10 +132,40 @@ jobs:
         DOCKER_IMAGE_ID: debian-java
         JDK: 11
 
+    - name: "Python on s390x"
+      os: linux
+      arch: s390x
+      env:
+        <<: *global_env
+        ARCH: s390x
+        ARROW_CI_MODULES: "PYTHON"
+        DOCKER_IMAGE_ID: ubuntu-python
+        # Can't enable ARROW_MIMALLOC because of failures in memory pool tests.
+        # Can't enable ARROW_S3 because compiler is killed while compiling
+        # aws-sdk-cpp.
+        DOCKER_RUN_ARGS: >-
+          "
+          -e ARROW_BUILD_STATIC=OFF
+          -e ARROW_FLIGHT=ON
+          -e ARROW_GCS=OFF
+          -e ARROW_MIMALLOC=OFF
+          -e ARROW_ORC=OFF
+          -e ARROW_PARQUET=OFF

Review comment:
       Should we set ARROW_DATASET to ON here? (as that was the original issue 
of enabling dataset but not parquet giving problems?)




-- 
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