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: Fix DataFrame.min/max for decimals #14890

Merged
merged 1 commit into from
Mar 6, 2024

Conversation

petrosbar
Copy link
Contributor

Now that decimals can be sorted (#14649), is_ord can be true for DataType::Decimal. This will in turn fix the following:

import polars as pl
from decimal import Decimal as D

pl.DataFrame({"a": [D("1.0"), D("2.0")]}).max()

output:

shape: (1, 1)
┌──────────────┐
│ a            │
│ ---          │
│ decimal[*,1] │
╞══════════════╡
│ null         │
└──────────────┘

expected:

shape: (1, 1)
┌──────────────┐
│ a            │
│ ---          │
│ decimal[*,1] │
╞══════════════╡
│ 2            │
└──────────────┘

Similar to #14652

@github-actions github-actions bot added fix Bug fix python Related to Python Polars rust Related to Rust Polars labels Mar 6, 2024
Copy link

codecov bot commented Mar 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.01%. Comparing base (4e521e8) to head (b2fc8b6).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #14890      +/-   ##
==========================================
- Coverage   81.01%   81.01%   -0.01%     
==========================================
  Files        1331     1331              
  Lines      172772   172773       +1     
  Branches     2455     2455              
==========================================
- Hits       139973   139966       -7     
- Misses      32332    32339       +7     
- Partials      467      468       +1     

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

Copy link
Member

@stinodego stinodego left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

@stinodego stinodego merged commit 3cf4897 into pola-rs:main Mar 6, 2024
24 checks passed
@petrosbar petrosbar deleted the is_ord_decimals branch March 6, 2024 19:58
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 rust Related to Rust Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants