Skip to content

Commit

Permalink
[dask] Remove dconcat. (#11178)
Browse files Browse the repository at this point in the history
  • Loading branch information
trivialfis authored Jan 21, 2025
1 parent 7c69d92 commit b57840f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
4 changes: 1 addition & 3 deletions python-package/xgboost/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,9 +508,7 @@ def __init__(
def get_callbacks(self, enable_categorical: bool) -> Tuple[Callable, Callable]:
"""Get callback functions for iterating in C. This is an internal function."""
assert hasattr(self, "cache_prefix"), "__init__ is not called."
reset_callback = ctypes.CFUNCTYPE(None, ctypes.c_void_p)(
self._reset_wrapper
)
reset_callback = ctypes.CFUNCTYPE(None, ctypes.c_void_p)(self._reset_wrapper)
next_callback = ctypes.CFUNCTYPE(
ctypes.c_int,
ctypes.c_void_p,
Expand Down
12 changes: 2 additions & 10 deletions python-package/xgboost/dask/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from dask import dataframe as dd

from .. import collective as coll
from .._typing import _T, FeatureNames
from .._typing import FeatureNames
from ..compat import concat, import_cupy
from ..core import DataIter, DMatrix, QuantileDMatrix
from ..data import is_on_cuda
Expand All @@ -33,14 +33,6 @@
_DataParts = List[Dict[str, Any]]


def dconcat(value: Sequence[_T]) -> _T:
"""Concatenate sequence of partitions."""
try:
return concat(value)
except TypeError:
return dd.multi.concat(list(value), axis=0)


meta = [
"label",
"weight",
Expand Down Expand Up @@ -383,7 +375,7 @@ def _create_dmatrix( # pylint: disable=too-many-locals
def concat_or_none(data: Sequence[Optional[T]]) -> Optional[T]:
if any(part is None for part in data):
return None
return dconcat(data)
return concat(data)

unzipped_dict = _get_worker_parts(list_of_parts)
concated_dict: Dict[str, Any] = {}
Expand Down

0 comments on commit b57840f

Please sign in to comment.