Skip to content

Commit

Permalink
fix sort multiple with booleans
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 committed Jan 15, 2022
1 parent 05c03fd commit 2d48db4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion polars/polars-core/src/series/series_trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub(crate) mod private {

pub trait PrivateSeriesNumeric {
fn bit_repr_is_large(&self) -> bool {
unimplemented!()
false
}
fn bit_repr_large(&self) -> UInt64Chunked {
unimplemented!()
Expand Down
16 changes: 16 additions & 0 deletions py-polars/tests/test_queries.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import polars as pl


def test_sort_by_bools() -> None:
# tests dispatch
df = pl.DataFrame(
{
"foo": [1, 2, 3],
"bar": [6.0, 7.0, 8.0],
"ham": ["a", "b", "c"],
}
)
out = df.with_column((pl.col("foo") % 2 == 1).alias("foo_uneven")).sort(
by=["foo", "foo_uneven"]
)
assert out.shape == (3, 4)

0 comments on commit 2d48db4

Please sign in to comment.