smaheshwar-pltr commented on code in PR #49667:
URL: https://github.com/apache/arrow/pull/49667#discussion_r3205339841


##########
python/pyarrow/includes/libparquet.pxd:
##########
@@ -633,6 +634,28 @@ cdef extern from "parquet/encryption/encryption.h" 
namespace "parquet" nogil:
             " parquet::FileDecryptionProperties":
         pass
 
+    cdef cppclass CFileDecryptionPropertiesBuilder\
+            " parquet::FileDecryptionProperties::Builder":
+        CFileDecryptionPropertiesBuilder() except +

Review Comment:
   (I don't think these specific calls actually reach a (C++) throw on the 
paths we hit, so this is being defensive. We do validations python-side that 
throw `TypeError` and `ValueError` on e.g. invalid length / algorithm.)
   
   If an exception was raised somehow though, I think we'd be fine and are 
consistent with elsewhere in this file - from 
https://cython.readthedocs.io/en/latest/src/userguide/wrapping_CPlusPlus.html#exceptions,
 the `except +` here would surface it as a `RuntimeError`.
   
   For example, `FileMetaData::AppendRowGroups` is also exposed as `except +` 
https://github.com/apache/arrow/blob/640b66cf96cb7e3d397c406411bbab89a14ef03a/python/pyarrow/includes/libparquet.pxd#L403
    
   and _reachably_ throws `ParquetException`
     
https://github.com/apache/arrow/blob/640b66cf96cb7e3d397c406411bbab89a14ef03a/cpp/src/parquet/metadata.cc#L933
   
   which would Cython surfaces as `RuntimeError` - we even have a test for 
this: 
https://github.com/apache/arrow/blob/640b66cf96cb7e3d397c406411bbab89a14ef03a/python/pyarrow/tests/parquet/test_metadata.py#L751



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