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

fix(python): Correctly parse special float values in from_repr #20351

Merged
merged 1 commit into from
Dec 19, 2024

Conversation

alexander-beedie
Copy link
Collaborator

@alexander-beedie alexander-beedie commented Dec 18, 2024

Closes #20328.

Handles inf, -inf, and nan values in the repr string.

Example

pl.from_repr(
    """
    # some sketchy float values
    Series: 'flt' [f64]
    [
        null
        +inf
        -inf
        inf
        0.0
        NaN
    ]
    >>> print("stuff")
    """
)

# shape: (6,)
# Series: 'flt' [f64]
# [
#     null
#     inf
#     -inf
#     inf
#     0.0
#     NaN
# ]

@github-actions github-actions bot added fix Bug fix python Related to Python Polars labels Dec 18, 2024
Copy link

codecov bot commented Dec 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.13%. Comparing base (676f10d) to head (64140e3).
Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #20351   +/-   ##
=======================================
  Coverage   79.13%   79.13%           
=======================================
  Files        1572     1572           
  Lines      219839   219847    +8     
  Branches     2462     2465    +3     
=======================================
+ Hits       173961   173970    +9     
+ Misses      45310    45309    -1     
  Partials      568      568           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ritchie46 ritchie46 merged commit 5fc9a19 into pola-rs:main Dec 19, 2024
17 checks passed
@alexander-beedie alexander-beedie deleted the from-repr-floats branch December 19, 2024 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix python Related to Python Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

from_repr from string with NaN values
2 participants