kylebarron commented on issue #34906:
URL: https://github.com/apache/arrow/issues/34906#issuecomment-1507606833

   From 
https://docs.python.org/3.11/tutorial/interactive.html#tab-completion-and-history-editing
   
   > Note that this may execute application-defined code if an object with a 
`__getattr__()` method is part of the expression
   
   So it looks like this is because `.schema` is a property, so it tries to get 
evaluated.
   
   ```py
   > python
   Python 3.11.1 (main, Jan 27 2023, 14:02:47) [Clang 14.0.0 
(clang-1400.0.29.202)] on darwin
   Type "help", "copyright", "credits" or "license" for more information.
   >>> import pyarrow as pa
   >>> reader = pa.RecordBatchReader()
   >>> reader.schema
   [1]    7847 segmentation fault  python
   ```
   
   If I mock out that method, it works:
   
   ```py
   > python
   Python 3.11.1 (main, Jan 27 2023, 14:02:47) [Clang 14.0.0 
(clang-1400.0.29.202)] on darwin
   Type "help", "copyright", "credits" or "license" for more information.
   >>> import pyarrow as pa
   >>> class MyReader(pa.RecordBatchReader):
   ...     @property
   ...     def schema(self):
   ...         return None
   ...
   >>> reader = MyReader()
   >>> reader.
   reader.close(                                 reader.read_all(               
               reader.read_pandas(
   reader.from_batches(                          reader.read_next_batch(        
               reader.schema
   reader.iter_batches_with_custom_metadata(     
reader.read_next_batch_with_custom_metadata(
   ```


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