Skip to content

Commit

Permalink
fix/skip some final tests
Browse files Browse the repository at this point in the history
  • Loading branch information
orlp committed Oct 2, 2024
1 parent a0c4ecc commit fa5c754
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 33 deletions.
73 changes: 40 additions & 33 deletions py-polars/tests/unit/datatypes/test_decimal.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,45 +322,52 @@ def test_decimal_aggregations() -> None:
"max": [D("10.10"), D("9000.12")],
}

assert df.select(
res = df.select(
sum=pl.sum("a"),
min=pl.min("a"),
max=pl.max("a"),
mean=pl.mean("a"),
median=pl.median("a"),
).to_dict(as_series=False) == {
"sum": [D("9110.33")],
"min": [D("0.10")],
"max": [D("9000.12")],
"mean": [2277.5825],
"median": [55.055],
}
)
expected = pl.DataFrame(
{
"sum": [D("9110.33")],
"min": [D("0.10")],
"max": [D("9000.12")],
"mean": [2277.5825],
"median": [55.055],
}
)
assert_frame_equal(res, expected)

assert df.describe().to_dict(as_series=False) == {
"statistic": [
"count",
"null_count",
"mean",
"std",
"min",
"25%",
"50%",
"75%",
"max",
],
"g": [4.0, 0.0, 1.5, 0.5773502691896257, 1.0, 1.0, 2.0, 2.0, 2.0],
"a": [
4.0,
0.0,
2277.5825,
4481.916846516863,
0.1,
10.1,
100.01,
100.01,
9000.12,
],
}
description = pl.DataFrame(
{
"statistic": [
"count",
"null_count",
"mean",
"std",
"min",
"25%",
"50%",
"75%",
"max",
],
"g": [4.0, 0.0, 1.5, 0.5773502691896257, 1.0, 1.0, 2.0, 2.0, 2.0],
"a": [
4.0,
0.0,
2277.5825,
4481.916846516863,
0.1,
10.1,
100.01,
100.01,
9000.12,
],
}
)
assert_frame_equal(df.describe(), description)


def test_decimal_df_vertical_sum() -> None:
Expand Down
2 changes: 2 additions & 0 deletions py-polars/tests/unit/test_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import numpy as np
import pandas as pd
import pytest

import polars as pl
from polars.testing import assert_frame_equal
Expand Down Expand Up @@ -110,6 +111,7 @@ def test_maintain_order_after_sampling() -> None:
assert result.to_dict(as_series=False) == expected


@pytest.mark.may_fail_auto_streaming
def test_sorted_group_by_optimization() -> None:
df = pl.DataFrame({"a": np.random.randint(0, 5, 20)})

Expand Down

0 comments on commit fa5c754

Please sign in to comment.