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

Suppress the complex group-by warning #104

Merged
merged 1 commit into from
Dec 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/tea_tasting/aggr.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import itertools
from typing import TYPE_CHECKING, overload
import warnings

import ibis.expr.operations
import ibis.expr.types
Expand Down Expand Up @@ -434,10 +435,12 @@ def _read_aggr_narwhals(
}
all_expr = count_expr | mean_expr | var_expr | cov_expr

aggr_data = (
data.select(**all_expr) if group_col is None
else data.group_by(group_col).agg(**all_expr)
)
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=UserWarning)
aggr_data = (
data.select(**all_expr) if group_col is None
else data.group_by(group_col).agg(**all_expr)
)
return aggr_data.collect().to_pandas()


Expand Down
Loading