jorisvandenbossche commented on code in PR #13033:
URL: https://github.com/apache/arrow/pull/13033#discussion_r863720613


##########
python/pyarrow/_dataset.pyx:
##########
@@ -783,11 +787,17 @@ cdef class FileFormat(_Weakrefable):
         if partition_expression is None:
             partition_expression = _true
 
-        c_source = _make_file_source(file, filesystem)
-        c_fragment = <shared_ptr[CFragment]> GetResultValue(
-            self.format.MakeFragment(move(c_source),
-                                     partition_expression.unwrap(),
-                                     <shared_ptr[CSchema]>nullptr))
+        cdef:
+            CFileSource c_source = _make_file_source(file, filesystem)
+            CResult[shared_ptr[CFileFragment]] c_result
+            CExpression c_partition_expression = partition_expression.unwrap()
+
+        with nogil:
+            c_result = self.format.MakeFragment(

Review Comment:
   Indeed, it seems that `MakeFragment` just takes the input path / source and 
filesystem and puts that in a FileFragment, and for example doesn't actually 
check the file for the schema (that is only done the first time when accessing 
the schema in `ReadPhysicalSchema`, and that part in cython is correctly 
releasing the GIL)



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