liusitan opened a new issue, #13535:
URL: https://github.com/apache/arrow/issues/13535

   This is the code for reading.
   preader.py
   
   ```python
   import pyarrow as pa
   # f = '/tmp/fib.arrow'
   f = 'arraydata.arrow'
   with pa.ipc.open_file(f) as reader:
       t = reader.read_all()
       print(t.to_string(show_metadata=True, preview_cols=2))
   This is the code for writing
   pwriter.py
   
   ```
   ```python
   import numpy as np
   import pyarrow as pa
   
   arr = pa.array(np.arange(8))
   schema = pa.schema([
       pa.field('nums', arr.type)
   ])
   n_legs = pa.array([2, 4, 5, 100])
   t = pa.Table.from_arrays([n_legs], names=["nums"],metadata = {"loc":"san 
diego"})
   with pa.OSFile('arraydata.arrow', 'wb') as sink:
       with pa.ipc.new_file(sink, schema=schema) as writer:
           # batch = pa.record_batch([arr], schema=schema)
           writer.write_table(t)
           
   ```
   weirdly, when I run the python writer first, and reader second, it does not 
print out the metadata stored, which is  {"loc":"san diego"}
   I am using macOS, if it matters:>
   <img width="498" alt="image" 
src="https://user-images.githubusercontent.com/20542539/177695553-f070a949-5656-4fbf-801c-2fae39397bee.png";>
   


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