From 262b38313adf49c8b12f11ada7b54357126d7464 Mon Sep 17 00:00:00 2001 From: Hassan Kibirige Date: Thu, 28 Nov 2024 12:40:34 +0300 Subject: [PATCH] TYP: Fix new typechecking failures Caused by upgrading pandas-stubs. --- plotnine/_utils/__init__.py | 2 +- plotnine/geoms/geom_ribbon.py | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/plotnine/_utils/__init__.py b/plotnine/_utils/__init__.py index b18f755c8..b43518a0a 100644 --- a/plotnine/_utils/__init__.py +++ b/plotnine/_utils/__init__.py @@ -985,7 +985,7 @@ def cross_join(df1: pd.DataFrame, df2: pd.DataFrame) -> pd.DataFrame: if len(df2) == 0: return df1 - return df1.join(df2, how="cross") # type: ignore + return df1.join(df2, how="cross") def to_inches(value: float, units: str) -> float: diff --git a/plotnine/geoms/geom_ribbon.py b/plotnine/geoms/geom_ribbon.py index d5582ea76..7a375c5df 100644 --- a/plotnine/geoms/geom_ribbon.py +++ b/plotnine/geoms/geom_ribbon.py @@ -181,10 +181,18 @@ def _draw_outline( if outline_type in ("lower", "both"): geom_path.draw_group( - data.eval(f"y = {y}min"), panel_params, coord, ax, **params + data.assign(y=data[f"{y}min"]), + panel_params, + coord, + ax, + **params, ) if outline_type in ("upper", "both"): geom_path.draw_group( - data.eval(f"y = {y}max"), panel_params, coord, ax, **params + data.assign(y=data[f"{y}max"]), + panel_params, + coord, + ax, + **params, )