Closed tanhevg closed 1 month ago
Not really a bug. We never supported this. I think we can support this by collecting the stream first.
If you wrap it in StringIO with read then it works.
from io import StringIO
proc = subprocess.Popen(cmd_str, shell=True,
stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE,
text=True, encoding='utf-8')
df=pl.read_csv(StringIO(proc.stdout.read()))
Checks
Reproducible example
Log output
Issue description
Polars does not allow reading a dataframe from piped csv output of another process - an
UnsupportedOperation: underlying stream is not seekable
error is thrown . The issue came up when migrating a bioinformatics pipeline from pandas, when processing a tsv output from an alignment search tool. For now the workaround is to write to a temporary file, but using piped directly, without the temporary file is much less cumbersome.Expected behavior
I would expect a dataframe to be created, e.g. with pandas:
Installed versions