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

Add "collect" aggregation support to dask-cudf #15593

Merged
merged 13 commits into from
May 1, 2024
Prev Previous commit
Next Next commit
clean up the message a bit
  • Loading branch information
rjzamora committed May 1, 2024
commit 2170e18c775a2901dd8748b655f4fb917c4df28e
29 changes: 15 additions & 14 deletions python/dask_cudf/dask_cudf/expr/_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
import cudf

_LEGACY_WORKAROUND = (
"To disable query planning, set the global "
"'dataframe.query-planning' config to `False` "
"before dask is imported. This can also be done "
"by setting an environment variable: "
"To enable the 'legacy' dask-cudf API, set the "
"global 'dataframe.query-planning' config to "
"`False` before dask is imported. This can also "
"be done by setting an environment variable: "
"`DASK_DATAFRAME__QUERY_PLANNING=False` "
)

Expand Down Expand Up @@ -98,18 +98,19 @@ def groupby(
)

if "as_index" in kwargs:
warnings.warn(
"The `as_index` argument is no longer supported in "
"dask-cudf when query-planning is enabled.",
FutureWarning,
msg = (
"The `as_index` argument is now deprecated. All groupby "
"results will be consistent with `as_index=True`.",
rjzamora marked this conversation as resolved.
Show resolved Hide resolved
)

if kwargs.pop("as_index", True) is not True:
raise NotImplementedError(
f"`as_index=False` is not supported. Please disable "
"query planning, or reset the index after aggregating.\n"
f"{_LEGACY_WORKAROUND}"
)
if kwargs.pop("as_index") is not True:
raise NotImplementedError(
f"{msg} Please reset the index after aggregating, or "
"use the legacy API if `as_index=False` is required.\n"
f"{_LEGACY_WORKAROUND}"
)
else:
warnings.warn(msg, FutureWarning)

return GroupBy(
self,
Expand Down
Loading