pitrou commented on code in PR #39781:
URL: https://github.com/apache/arrow/pull/39781#discussion_r1480191173


##########
python/pyarrow/_parquet.pyx:
##########
@@ -849,6 +849,18 @@ cdef class FileMetaData(_Weakrefable):
         cdef Buffer buffer = sink.getvalue()
         return _reconstruct_filemetadata, (buffer,)
 
+    def __hash__(self):
+        def flatten(obj):

Review Comment:
   But then you probably want to make `pa.Buffer` hashable as well:
   ```python
   >>> stream = pa.BufferOutputStream()
   >>> stream.write(b"xxx")
   3
   >>> stream.getvalue()
   <pyarrow.Buffer address=0x7f84af208000 size=3 is_cpu=True is_mutable=True>
   >>> stream.getvalue() == b"xxx"
   True
   >>> hash(stream.getvalue())
   Traceback (most recent call last):
     Cell In[9], line 1
       hash(stream.getvalue())
   TypeError: unhashable type: 'pyarrow.lib.Buffer'
   ```



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