Skip to content

Commit

Permalink
workaround strange polars filter error
Browse files Browse the repository at this point in the history
  • Loading branch information
dhimmel committed Oct 28, 2024
1 parent 4de1dbd commit d33eb0d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ski_bearings/tests/test_bearing.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,12 @@ def test_get_bearing_summary_stats_repeated_aggregation() -> None:
analyze_all_ski_areas()
# group by hemisphere to avoid polars
# ComputeError: at least one key is required in a group_by operation
hemisphere_pl = aggregate_ski_areas_pl(group_by=["hemisphere"])
hemisphere_pl = aggregate_ski_areas_pl(
group_by=["hemisphere"],
# on test data, the default .filter(pl.lit(True)) gave a polars error:
# ShapeError: filter's length: 1 differs from that of the series: 2
ski_area_filters=[pl.col("hemisphere").is_not_null()],
)
double_pass = hemisphere_pl.row(by_predicate=pl.lit(True), named=True)
for key in [
"mean_bearing",
Expand Down

0 comments on commit d33eb0d

Please sign in to comment.