antspy commented on issue #46073:
URL: https://github.com/apache/arrow/issues/46073#issuecomment-2791691664

   Thank you for your answer! 
   
   Any sort of dataframe works - for example: 
   
   ```python
   import polars as pl 
   
   @router.get('/df')
   def df() -> Response:
     """Returns a sample polars dataframe in ipc format."""
     ...
     buffer = pl.Dataframe({'test': ['a', 'b', 'c']}).write_ipc(None, 
compression='uncompressed')
     buffer.seek(0)
     return Response(
       buffer.getvalue(),
       media_type='application/octet-stream',
       headers={'Content-Type': 'application/octet-stream'},
     )
   ```
   
   This results in the same error. I have attached the downloaded file, but as 
a stream of bytes it should be the same as whatrever `buffer = 
pl.Dataframe({'test': ['a', 'b', 'c']}).write_ipc(None, 
compression='uncompressed')` returns. 
   
   (I had to save the file with `.txt` extension otherwise github would not 
allow me to upload it. Just remove the `.txt` extension, the bytes themselves 
should be correct). 
   
   
[download.txt](https://github.com/user-attachments/files/19679093/download.txt)


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