jorisvandenbossche commented on issue #41741:
URL: https://github.com/apache/arrow/issues/41741#issuecomment-2124222795

   A reproducer just with pyarrow as well (using your registered ext type 
example):
   
   ```python
   class DummyArray:
       def __init__(self):
           self._field = pa.field("", pa.null(), 
metadata={"ARROW:extension:name": "arrow.test"})
           self._array = pa.array([None, None], pa.null())
   
       def __arrow_c_array__(self, requested_schema=None):
           return self._field.__arrow_c_schema__(), 
self._array.__arrow_c_array__()[1]
   
   pa.array(DummyArray())
   ```
   
   which crashes, and when adding `"ARROW:extension:metadata": ""` to the dict, 
it works.
   
   Now, apart from your fix (thanks for that!), I realize from the example that 
it is right now actually impossible to register an extension type without 
metadata (at least from Python). 
   
   I don't know it we should fix that (e.g. allow `__arrow_ext_serialize__` to 
return None in addition to bytes?), or whether this is OK as long as we ensure 
this still works when actually receiving data with extension types without 
metadata (i.e. your fix for this issue)


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