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

str.json_decode hangs on nested JSON structure with null values #18781

Closed
2 tasks done
nsfinkelstein opened this issue Sep 16, 2024 · 3 comments
Closed
2 tasks done

str.json_decode hangs on nested JSON structure with null values #18781

nsfinkelstein opened this issue Sep 16, 2024 · 3 comments
Labels
bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars

Comments

@nsfinkelstein
Copy link

nsfinkelstein commented Sep 16, 2024

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

import polars as pl
pl.Series([
    '{"a":[{"b":false}]}',
    '{"a":[{"b":null}]}',
    '{"a":null}',
]).str.json_decode()

Log output

No response

Issue description

The above and related code hangs interminably.

This code runs correctly on polars version 1.6.0, with all other versions the same.

Expected behavior

shape: (3,)
Series: '' [struct[1]]
[
        {[{false}]}
        {[{null}]}
        {null}
]

Installed versions

--------Version info---------
Polars:              1.7.1
Index type:          UInt32
Platform:            Linux-5.10.219-208.866.amzn2.x86_64-x86_64-with-glibc2.35
Python:              3.11.9 (main, Sep  8 2024, 07:11:41) [GCC 11.4.0]

----Optional dependencies----
adbc_driver_manager  <not installed>
altair               <not installed>
cloudpickle          3.0.0
connectorx           <not installed>
deltalake            <not installed>
fastexcel            <not installed>
fsspec               2024.9.0
gevent               <not installed>
great_tables         <not installed>
matplotlib           3.9.2
nest_asyncio         1.6.0
numpy                1.26.4
openpyxl             <not installed>
pandas               2.2.2
pyarrow              17.0.0
pydantic             2.8.2
pyiceberg            <not installed>
sqlalchemy           2.0.34
torch                2.3.1+cu121
xlsx2csv             <not installed>
xlsxwriter           <not installed>
@nsfinkelstein nsfinkelstein added bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars labels Sep 16, 2024
@cmdlineluser
Copy link
Contributor

cmdlineluser commented Sep 16, 2024

This segfaults for me with a debug build.

zsh: segmentation fault

If it helps narrow things down, it seems to have started after this PR:

@cmdlineluser
Copy link
Contributor

This is still reproducible as of 1.8.1

Hope the ping is OK @ritchie46 - but it seems like this one may need attention if it is not on the radar already.

@ritchie46
Copy link
Member

Ah, I missed it. But.... I coincidentally encountered and fixed it myself! :D

Fixed in #18887

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars
Projects
None yet
Development

No branches or pull requests

3 participants