Skip to content

Commit

Permalink
Add patch
Browse files Browse the repository at this point in the history
  • Loading branch information
wjsi committed Oct 29, 2023
1 parent a243599 commit 6c97cc6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/platform-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ jobs:
# Ray Datasets need pyarrow>=6.0.1
pip install "pyarrow>=6.0.1"
pip install lightgbm
# patch xgboost_ray and xgboost incompatibility
cp ./ci/xgboost_ray_patch.pth "$(python -c 'import site; print(site.getsitepackages()[0])')"
fi
if [ -n "$RUN_DASK" ]; then
pip install "dask[complete]" "mimesis<9.0.0" scikit-learn
Expand Down
1 change: 1 addition & 0 deletions ci/xgboost_ray_patch.pth
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
exec('try:\n import xgboost.sklearn\n xgboost.sklearn.XGBRanker.predict.__doc__ = ""\n xgb_skl = importlib.import_module("xgboost_ray.sklearn")\n classes_prop = xgb_skl.RayXGBClassifier.classes_\n xgb_skl.RayXGBClassifier.classes_ = property(fget=classes_prop.fget, fset=classes_prop.fset or (lambda self, x: None))\nexcept:\n pass')
5 changes: 3 additions & 2 deletions mars/dataframe/contrib/raydataset/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ def __getstate__():
state.pop("dataframe", None)
return state

# `dataframe` is not serializable by ray.
dataset.__getstate__ = __getstate__
if not hasattr(type(dataset), "__getstate__"):
# if `dataframe` is not serializable by ray, patch our implementation
dataset.__getstate__ = __getstate__

Check warning on line 61 in mars/dataframe/contrib/raydataset/dataset.py

View check run for this annotation

Codecov / codecov/patch

mars/dataframe/contrib/raydataset/dataset.py#L61

Added line #L61 was not covered by tests
return dataset


Expand Down
5 changes: 3 additions & 2 deletions mars/dataframe/contrib/raydataset/mldataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ def __getstate__():
state.pop("dataframe", None)
return state

# `dataframe` is not serializable by ray.
dataset.__getstate__ = __getstate__
if not hasattr(dataset, "__getstate__"):
# `dataframe` is not serializable by ray.
dataset.__getstate__ = __getstate__

Check warning on line 136 in mars/dataframe/contrib/raydataset/mldataset.py

View check run for this annotation

Codecov / codecov/patch

mars/dataframe/contrib/raydataset/mldataset.py#L136

Added line #L136 was not covered by tests
return dataset

0 comments on commit 6c97cc6

Please sign in to comment.