pitrou commented on pull request #8312:
URL: https://github.com/apache/arrow/pull/8312#issuecomment-702017880


   The problem is that this won't be visible from C++ code, which will still 
get `extension<arrow.py_extension_type>`.
   ```python
   >>> ty
   IntegerType(DataType(int64))
   >>> pa.DataType.__str__(ty)
   'extension<arrow.py_extension_type>'
   ```
   
   Solving this requires some collaboration with the C++ side.  I advise you to 
take a look at 
[`cpp/src/arrow/python/extension_type.h`](https://github.com/apache/arrow/blob/master/cpp/src/arrow/python/extension_type.h).
 You'll probably need to override the `ToString` method in 
`arrow::py::PyExtensionType`. By default it can return the same as 
`ExtensionType::ToString`, but it can also query a Python attribute on 
`type_instance` to get a custom string.


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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to