raulcd commented on code in PR #46354:
URL: https://github.com/apache/arrow/pull/46354#discussion_r2081664745


##########
python/pyarrow/ipc.pxi:
##########
@@ -1192,6 +1198,13 @@ cdef class _RecordBatchFileReader(_Weakrefable):
             raise ValueError("Operation on closed reader")
         return _wrap_read_stats(self.reader.get().stats())
 
+    @property
+    def metadata(self):
+        """
+        File-level custom KeyValueMetadata written via ``ipc.new_file(..., 
metadata=)``.
+        """
+        return pyarrow_wrap_metadata(self.reader.get().metadata())

Review Comment:
   In other metadata properties, i.e: 
https://github.com/apache/arrow/blob/88815a1f6ffcfbcecdfb7c0863795123ebf1a733/python/pyarrow/types.pxi#L2591-L2595
   
   We return either a dict or None, I think we should do the same to follow 
consistency on our APIs.
   ```suggestion
           wrapped = pyarrow_wrap_metadata(self.reader.get().metadata())
           if wrapped is not None:
               return wrapped.to_dict()
           else:
               return wrapped
   ```



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