-
Notifications
You must be signed in to change notification settings - Fork 94
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
Clean up imports for dask>2024.12.1
support
#1424
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ | |
from dask.base import tokenize | ||
from dask.dataframe import DataFrame, Series | ||
from dask.dataframe.core import _concat as dd_concat | ||
from dask.dataframe.shuffle import group_split_dispatch, hash_object_dispatch | ||
from dask.dataframe.dispatch import group_split_dispatch, hash_object_dispatch | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All dispatch functions have been centralized in the |
||
from distributed import wait | ||
from distributed.protocol import nested_deserialize, to_serialize | ||
from distributed.worker import Worker | ||
|
@@ -31,6 +31,20 @@ | |
Proxify = Callable[[T], T] | ||
|
||
|
||
try: | ||
from dask.dataframe import dask_expr | ||
|
||
except ImportError: | ||
# TODO: Remove when pinned to dask>2024.12.1 | ||
import dask_expr | ||
|
||
if not dd._dask_expr_enabled(): | ||
raise ValueError( | ||
"The legacy DataFrame API is not supported in dask_cudf>24.12. " | ||
"Please enable query-planning, or downgrade to dask_cudf<=24.12" | ||
) | ||
|
||
|
||
def get_proxify(worker: Worker) -> Proxify: | ||
"""Get function to proxify objects""" | ||
from dask_cuda.proxify_host_file import ProxifyHostFile | ||
|
@@ -576,7 +590,6 @@ def patch_shuffle_expression() -> None: | |
an `ECShuffle` expression when the 'explicit-comms' | ||
config is set to `True`. | ||
""" | ||
import dask_expr | ||
|
||
class ECShuffle(dask_expr._shuffle.TaskShuffle): | ||
"""Explicit-Comms Shuffle Expression.""" | ||
|
@@ -585,7 +598,7 @@ def _layer(self): | |
# Execute an explicit-comms shuffle | ||
if not hasattr(self, "_ec_shuffled"): | ||
on = self.partitioning_index | ||
df = dask_expr._collection.new_collection(self.frame) | ||
df = dask_expr.new_collection(self.frame) | ||
self._ec_shuffled = shuffle( | ||
df, | ||
[on] if isinstance(on, str) else on, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved this logic into
explicit_comms.dataframe.shuffle
since that's really the only place in Dask-CUDA where dask-expr matters.