Skip to content

Commit

Permalink
fix: fix broken link from warning
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGorelli committed Jan 5, 2025
1 parent 03f6754 commit 542be67
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions narwhals/_pandas_like/group_by.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
)
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion narwhals/_spark_like/group_by.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 542be67

Please sign in to comment.