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 incorrect output height for SQL SELECT COUNT(*) FROM #21108

Merged
merged 4 commits into from
Feb 7, 2025

Conversation

nameexhaustion
Copy link
Collaborator

@nameexhaustion nameexhaustion commented Feb 6, 2025

Note that this fix will also change the behavior of the following query (also adds a test for it):

df = pl.DataFrame(
    {
        "list_long": [[1, 2, 3], [4, 5, 6]],
        "sort_key": [2, 1],
    }
)

df.sql("SELECT UNNEST(list_long) FROM self ORDER BY sort_key")

# Before
polars.exceptions.ShapeError: unable to add a column of length 6 to a DataFrame of height 2
# After
shape: (6, 1)
┌───────────┐
│ list_long │
│ ---       │
│ i64       │
╞═══════════╡
│ 2         │
│ 1         │
│ 3         │
│ 4         │
│ 5         │
│ 6         │
└───────────┘

Drive-by fixes LazyFrame::join() in Rust ignoring the maintain_order option.

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

codecov bot commented Feb 6, 2025

Codecov Report

Attention: Patch coverage is 98.93617% with 1 line in your changes missing coverage. Please review.

Project coverage is 79.30%. Comparing base (15fa50a) to head (ae18074).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
crates/polars-lazy/src/frame/mod.rs 96.77% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #21108      +/-   ##
==========================================
+ Coverage   79.29%   79.30%   +0.01%     
==========================================
  Files        1589     1589              
  Lines      226515   226597      +82     
  Branches     2594     2594              
==========================================
+ Hits       179611   179703      +92     
+ Misses      46308    46298      -10     
  Partials      596      596              

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

@nameexhaustion nameexhaustion marked this pull request as ready for review February 6, 2025 13:23
@nameexhaustion nameexhaustion marked this pull request as draft February 6, 2025 16:33
@nameexhaustion nameexhaustion marked this pull request as ready for review February 7, 2025 04:18
@ritchie46 ritchie46 merged commit 143f122 into pola-rs:main Feb 7, 2025
27 checks passed
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.

Count(*) does not aggregate rows
2 participants