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

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   With the following script:
   
   ```
   from pyarrow import csv
   from io import BytesIO
   from concurrent.futures import ThreadPoolExecutor
   
   data = "x,y,z"
   
   def read_csv_pyarrow(i):
       try:
           csv.read_csv(BytesIO(data.encode()))
       except:
           pass
       print(i)
       return i
   
   with ThreadPoolExecutor(4) as e:
       list(e.map(read_csv_pyarrow, range(20)))
   ```
   
   this occasionally hangs.
   
   Reading the file itself gives the "ArrowInvalid: CSV parse error: Empty CSV 
file or block: cannot infer number of columns" error:
   
   
https://github.com/apache/arrow/blob/db19a358cdf2b550b741fc7574dea38a6e32261b/cpp/src/arrow/csv/parser.cc#L545
   
   We discovered this in the pandas test suite 
(https://github.com/pandas-dev/pandas/pull/55687)
   
   ### Component(s)
   
   C++


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