Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polars panics when trying to read ndjson from a file-like object #13273

Closed
2 tasks done
jamesperez2005 opened this issue Dec 27, 2023 · 1 comment · Fixed by #16971
Closed
2 tasks done

Polars panics when trying to read ndjson from a file-like object #13273

jamesperez2005 opened this issue Dec 27, 2023 · 1 comment · Fixed by #16971
Assignees
Labels
A-panic Area: code that results in panic exceptions accepted Ready for implementation bug Something isn't working P-medium Priority: medium python Related to Python Polars

Comments

@jamesperez2005
Copy link

Checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of Polars.

Reproducible example

df = pl.DataFrame(
    {
        'x': [1, 2, 3],
        'y': ['a', 'b', 'c'],
    }
)
df.write_ndjson("/tmp/testme.ndjson")
pl.read_ndjson(open("/tmp/testme.ndjson"))

Log output

No response

Issue description

It is very useful to be able to read ndjson from file objects, e.g. when reading compressed data

Expected behavior

The dataframe should be successfully read

Installed versions

--------Version info---------
Polars:               0.20.2
Index type:           UInt32
Platform:             macOS-14.2.1-arm64-arm-64bit
Python:               3.8.13 (default, Jun 26 2022, 15:51:52) 
[Clang 13.1.6 (clang-1316.0.21.2.5)]

----Optional dependencies----
adbc_driver_manager:  <not installed>
cloudpickle:          <not installed>
connectorx:           <not installed>
deltalake:            <not installed>
fsspec:               2022.10.0
gevent:               <not installed>
matplotlib:           3.6.1
numpy:                1.23.4
openpyxl:             3.1.2
pandas:               1.5.1
pyarrow:              9.0.0
pydantic:             <not installed>
pyiceberg:            <not installed>
pyxlsb:               <not installed>
sqlalchemy:           1.4.42
xlsx2csv:             <not installed>
xlsxwriter:           <not installed>
@jamesperez2005 jamesperez2005 added bug Something isn't working python Related to Python Polars labels Dec 27, 2023
@jamesperez2005
Copy link
Author

Same reproduces with read_json/write_json, BTW

@stinodego stinodego added the accepted Ready for implementation label Dec 27, 2023
@github-project-automation github-project-automation bot moved this to Ready in Backlog Dec 27, 2023
@stinodego stinodego added P-medium Priority: medium and removed accepted Ready for implementation labels Jan 13, 2024
@coastalwhite coastalwhite added the A-panic Area: code that results in panic exceptions label Jun 14, 2024
@github-project-automation github-project-automation bot moved this from Ready to Done in Backlog Jun 15, 2024
@c-peters c-peters added the accepted Ready for implementation label Jun 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-panic Area: code that results in panic exceptions accepted Ready for implementation bug Something isn't working P-medium Priority: medium python Related to Python Polars
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants