Skip to content
This repository was archived by the owner on Jan 12, 2026. It is now read-only.

Commit 070c2a7

Browse files
authored
[CI] Fix ray datasets example and tests, update cutting edge test (#187)
1 parent 10abeee commit 070c2a7

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

xgboost_ray/examples/simple_ray_dataset.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ def main(cpus_per_actor, num_actors):
1919
y[bits_to_flip] = 1 - y[bits_to_flip]
2020

2121
data = pd.DataFrame(x)
22+
# Ray Datasets require all columns to be string
23+
data.columns = [str(c) for c in data.columns]
2224
data["label"] = y
2325

2426
# There was recent API change - the first clause covers the new

xgboost_ray/tests/test_data_source.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,8 @@ class RayDatasetSourceTest(_DistributedDataSourceTest, unittest.TestCase):
443443
def _testAssignPartitions(self, part_nodes, actor_nodes,
444444
expected_actor_parts):
445445
partitions = [
446-
ray.put(pd.DataFrame(p))
446+
ray.put(
447+
pd.DataFrame(p, columns=[str(x) for x in range(p.shape[1])]))
447448
for p in np.array_split(self.x, len(part_nodes))
448449
]
449450

xgboost_ray/tests/test_sklearn.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -387,10 +387,7 @@ def test_parameter_tuning(self):
387387
)
388388
clf.fit(X, y)
389389
assert clf.best_score_ < 0.7
390-
if XGBOOST_VERSION_TUPLE >= (1, 6, 0):
391-
assert clf.best_params_ == {"n_estimators": 200, "max_depth": 2}
392-
else:
393-
assert clf.best_params_ == {"n_estimators": 100, "max_depth": 4}
390+
assert clf.best_params_ == {"n_estimators": 100, "max_depth": 4}
394391

395392
def test_regression_with_custom_objective(self):
396393
self._init_ray()

0 commit comments

Comments
 (0)