From 0800bfa7104c7f7447188e5d95bee75086e93d04 Mon Sep 17 00:00:00 2001 From: Marco Edward Gorelli Date: Sun, 5 Jan 2025 22:25:52 +0000 Subject: [PATCH] fix: fix broken link from warning (#1732) --- narwhals/_pandas_like/group_by.py | 4 ++-- narwhals/_spark_like/group_by.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/narwhals/_pandas_like/group_by.py b/narwhals/_pandas_like/group_by.py index 3741c7130..0f1000606 100644 --- a/narwhals/_pandas_like/group_by.py +++ b/narwhals/_pandas_like/group_by.py @@ -337,7 +337,7 @@ def agg_pandas( # noqa: PLR0915 "pandas API. If you can, please rewrite your query such that group-by aggregations " "are simple (e.g. mean, std, min, max, ...). \n\n" "Please see: " - "https://narwhals-dev.github.io/narwhals/pandas_like_concepts/improve_group_by_operation.md/", + "https://narwhals-dev.github.io/narwhals/pandas_like_concepts/improve_group_by_operation/", UserWarning, stacklevel=find_stacklevel(), ) @@ -349,7 +349,7 @@ def func(df: Any) -> Any: results_keys = expr(from_dataframe(df)) if not all(len(x) == 1 for x in results_keys): msg = f"Aggregation '{expr._function_name}' failed to aggregate - does your aggregation function return a scalar? \ - \n\n Please see: https://narwhals-dev.github.io/narwhals/pandas_like_concepts/improve_group_by_operation.md/" + \n\n Please see: https://narwhals-dev.github.io/narwhals/pandas_like_concepts/improve_group_by_operation/" raise ValueError(msg) for result_keys in results_keys: diff --git a/narwhals/_spark_like/group_by.py b/narwhals/_spark_like/group_by.py index d53237b59..c7cc52bf1 100644 --- a/narwhals/_spark_like/group_by.py +++ b/narwhals/_spark_like/group_by.py @@ -162,6 +162,6 @@ def agg_pyspark( result_simple = grouped.agg(*agg_columns) except ValueError as exc: # pragma: no cover msg = "Failed to aggregated - does your aggregation function return a scalar? \ - \n\n Please see: https://narwhals-dev.github.io/narwhals/pandas_like_concepts/improve_group_by_operation.md/" + \n\n Please see: https://narwhals-dev.github.io/narwhals/pandas_like_concepts/improve_group_by_operation/" raise RuntimeError(msg) from exc return from_dataframe(result_simple)