kou commented on code in PR #37097:
URL: https://github.com/apache/arrow/pull/37097#discussion_r1295113131


##########
python/pyarrow/_dataset_parquet.pyx:
##########
@@ -741,7 +737,15 @@ cdef class ParquetFragmentScanOptions(FragmentScanOptions):
             thrift_string_size_limit=self.thrift_string_size_limit,
             thrift_container_size_limit=self.thrift_container_size_limit,
         )
-        return type(self)._reconstruct, (kwargs,)
+        return _reconstruct_parquet_fragment_scan_options, (kwargs,)
+
+
+def _reconstruct_parquet_fragment_scan_options(kwargs):
+    # __reduce__ doesn't allow passing named arguments directly to the
+    # reconstructor, hence this wrapper.
+    # In Cython >= 3.0.0, function binding is turned on by default, so
+    # a global static method is used (instead of a class method) for pickling.
+    return ParquetFragmentScanOptions(**kwargs)

Review Comment:
   Can we check that this change still works with Cython < 3?



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